Disclaimer: This site is moderated by the Formidable Forms community. Formidable Forms and its parent company Strategy11 are not responsible for the words, opinions, and content posted by others on this site. This site is provided as a courtesy and free resource for the Formidable Forms Community. Any actions deemed as harassment, toxic or abusive, will result on being banned from this site and potentially losing your Formidable Forms license.
Thanks for your cooperation, if you have any questions please
consult our code of conduct
I changed the action URL to a requestbin url and submitted the data to there to inspect the content. You can see the output here: https://snipboard.io/6leDLE.jpg
So the issue seems to be that the Formidable API functionality is receiving the value as the URL and not translating that to the other option.
That's a good guess, but it's not what's happening. The other field is actually not named 162 or 'smdvv'. In code it's referenced as 'other_2' and because it's a tack-on option to field 162, its full name in code is [162][other_2].
This is what I see in the database with a test field and only the other option populated:
a:1:{s:7:"other_2";s:17:"http://google.com";}
The reference is other_2. I don't know how you would reference the other field directly through the API, buy you could do something withe data in this hook: https://formidableforms.com/knowledgebase/frm_api_post_response/
<p>Thank you Victor.</p><p> </p><p>I have to admit I'm a bit confused. Does this mean that on the receiving site I have to add one of these hooks that will update the record AFTER the api receives and writes it? I don't really understand how the hook would be used for this since what I'm seeing is very generic. I have no idea the body would look like and I have no way to output the body to something so I can debug it.</p><p> </p><p>Would the line $returned_id = $body["CHANGEME"];</p><p> </p><p>for me be something like:</p><p>$redirect_value = $body["smdvv"];</p><p>if (stristr($redirect_value,"http")) {</p><p> // update record's other_2 value</p><p>}</p><p> </p><p>Trying to understand how to handle this.</p><p> </p><p>Thank you!</p>
argh the editor on this forum sucks. It needs markup support.
This is the first time anyone has ever asked about populating the "other" field through the API. I only know that Formidable requires it to be saved as part of the serialized data returned for the input using the other field.
This means you have to specifically identify the values key-value pair with the key "other_2" otherwise it will never populate the other field. I have no time to dig into code to find a different way, but the only thing I can recommend now is to use the hook to retrieve the value intended for the other field and dress it as a serialized array and populate the field in frm_item_metas as you would to update any meta value programmatically.