How can I create a variable that is not inside the form that changes value according to the created id?

By: Pablo Passberg | Asked: 07/13/2022
ForumsCategory: Code HelpHow can I create a variable that is not inside the form that changes value according to the created id?
Pablo Passberg asked 2 years ago
example if id <= 5{Person ="Jake"} 
if id > 2 {Person ="Connor"}


and then send that variable to google sheets via API.
 
 
1 Answers
Best Answer
Victor Font answered 2 years ago
The way you have it written, you can't. If id > 2 will produce the same value as id <= 5. You can use conditionals in the API action and conditionals can include [else], but this is only for 2 values. If you used the values in your example, the conditional is: [if x less_than="6"]Jake[ELSE]Connor[/if x] This conditional will never display "Connor" because 2 is <= 5. If you can provide more details about what you're trying to accomplish, maybe someone can share a solution. Where is ID coming from?
Pablo Passberg replied 2 years ago

hello victor the example that I put earlier if id <= 5{Person ="Jake"} is fictitious, what I want to do is organize the entries acquired by the form and send them to different people, that's why it occurred to me that if I organize the entries Through the id I could have some control and establish who I want to send the entry to first, that's why I need to create a variable that changes its name according to the value of the id created from an entries

The thing is that I don't know where to enter the shortcodes, nor what code would help me.

Victor Font replied 2 years ago

Please explain the process you are using when you say, "organize the entries acquired by the form and send them to different people"? How are you sending entries to different people?

Pablo Passberg replied 2 years ago

I send them via api to a program called pabbly connect, there I enter the id and all the values ​​of the form once I get to pabbly I can establish rules such as if client = "pablo" a notification is sent by whatsapp to a number specific.

Victor Font replied 2 years ago

Pabbly Connect is like Zapier that is used to connect applications together. Let me see if I', following the use case so far:

1. a user enters details in a form
2. when the entry is submitted, the entry details are forwarded to Pabbly Connect through the Formidable API-add-on
3. The data goes to Pabbly, then what? What application is Formidable data connecting to on Pabbly to send the emails? Does Pabbly send emails? Why wouldn't you just use Formidable to send the emails?

The process you're describing is not clear as to why you are sending the form entries to Pabbly.

If all you need is a field that has the content, client = "pablo", then create the value from your form entries with jQuery and save it to a hidden field. Send the hidden field to Pabbly with the rest of the data.

Pablo Passberg replied 2 years ago

once the information arrives at pabbly there is an event called trigger (which saves all the information sent by the api, for example: name, email, phone, entry id, etc)
then in pabbly there is the possibility to create filters (greater or less, equal to etc)
then I can create a filter in which if the advisor variable = "pablo" sends that information to the whatsapp number that I want, that's why it occurred to me to create a code in formidable ways that depending on the value of the entrie id can change the name of a variable either Pablo,Pedro,Juan etc

but I don't know what code I need or where I can add it

Victor Font replied 2 years ago

We can't help you with Pabbly. I already suggested sending the value you need in a hidden field and let jQuery format the value. You'll have to get support from Pabbly for anything that happens or doesn't happen on their side of the equation.

Pablo Passberg replied 2 years ago

thank you very much for your time the thing is that I don't know where jQuery format the value

Victor Font replied 2 years ago

When you write your jQuery, you add it to the After Fields section on the form's Customize HTML page.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right