Zapier form dynamic inputFields manipulation - zapier

I'd like to manipulate the input fields of a trigger form dynamically:
I have a trigger 'hidden' with a combo-box in a form
Each time I update the combo, it should add one or more combo-boxes in the same form depending on the value
I couldn't find any way to access the operation.inputFields somewhere for doing an update on this list dynamically, whether via the bundle or else...
Here is the small example: https://github.com/nuxeo-sandbox/nuxeo-zapier/blob/spikes-NXP-26085-zapier/nuxeo-zapier-app/triggers/project.js#L8-L16
Thank you for your help!
Vlad

David here, from the Zapier Platform team.
It sounds like you're looking for Custom Fields: https://github.com/zapier/zapier-platform-cli#customdynamic-fields
In addition to a static list of input fields, you can provide a function that will run and provide a dynamic set of fields. It's how we get inputs for each column in a google sheet:
Is that what you're asking? Modifying the inputFields array at runtime probably doesn't do what you want.

Related

Zapier dynamic dropdown on condition

I'm updating a Zapier APP through the Web builder. I need to add two fields:
The label of the first is "Vat Description", and is a text input field;
The second is "Vat Nature", a dropdown list.
I want to make this field required only if the value of the first is 0, or 0%
Any suggestions? thanks
David here, from the Zapier Platform team.
This is pretty straightforward to do. You want to put the second field in a function, which will generate it dynamically based on the contents of the first field. You can adjust whether or not it's required.
There's docs about this here.

Can you include an input field in a drop down list using select-2?

I am using select-2 for a list of states. I think its great and love the search input field it provides. I'm wondering though, is it possible to include another input so someone can manually enter information ~ I am hoping to add an "Other" or "International" field to this drop down so instead of including all the states / provinces / territories of the world I provide a field they can manually enter if the territiry if it's not included in the drop down list.
Is an input in a drop down even possible? I would like to try and stick with Select2 as I like the added features it provides.
You can add items manually to the select2 dropdown using the "tagging" function. See the link for more information: https://select2.org/tagging

Select or input

In my app I have a form for creating new trip. Model Trip has field finish_address. For setup the finish_address in I use select in simple form to select address from user's addressbook. But I want to make a better form: if there isn't necessary address, user can add it using input field.
So I need to make form with to types of setup finish_address. How can I make it?
You have 2 basic options.
You can use autocomplete on a text input, populating a dynamic crop-down with know values.
There are several gems available to get you started in this direction, like https://github.com/crowdint/rails3-jquery-autocomplete.
Alternatively, you can add an "other" option to a select input, populated with your known values. When the "other" item is selected, display a previously hidden text input with the same name below the select input. The "lowest" element will take precedence, for what gets sent to the controller.
In the controller, just do a find_or_create_by, using your provided value.
These options both require javascript, but you can eliminate the need for javascript if you make your select a non-db-backed attribute, and manipulate your params accordingly, as they come in to the model. This might help with validations, as well.

New List item customisation

I currently have a custom list which contains about 20 columns, however when my user selects new to add in a new item to the list I want to only show 10 of the 20 fields.
The default setting allows me to hide some fields but this option is not what i need as later on in the workflow i require a user to add in data to say items 11-20.
I need a couple of data entry forms
new - show say columns 1-10
update - modify columns 1-10 if required and add data to columns 10-15
authorise - modify columns 1-15 if required and add data to columns 15-20
Ideally each data entry form should have its own workflow but that can come later and is a nice to have
any help please ?
by the way sharepoint designer is not an option for me, I do however have info path available.
If it is a custom list you can define which fields are going to be available on each form using the attributes ShowInDisplayForm, ShowInEditForm and ShowInNewForm.
http://msdn.microsoft.com/en-us/library/aa543225.aspx
I usually use them when im define the content type.
<FieldRef ID="{493AE2E2-DA5D-46C6-93D9-D43F85B03329}" Name="myCustomField" Required="FALSE" ShowInNewForm="TRUE" ShowInEditForm="FALSE"/>
i hope it helps!

run SPD workflow on changes to any field EXCEPT one?

I have a custom list. Each item in the list has 39 fields/columns that need to be filled out and a 40th field that gets filled out by a separate workflow.
I have another workflow that I need to trigger if any of the fields change EXCEPT for one.
Why? Because that field has a custom ID# in it and that field gets populated AFTER the form is submitted. Therefore, there will ALWAYS be a change in the list item. Thus, I need a workflow to trigger when any fields change EXCEPT the one w/ the custom ID#.
Any ideas? Thank you.
No one has been able to answer this but I figured it out myself.
I'm including the answer here in case anyone else ever comes across this and finds it helpful:
Create a new field that you will hide from the your SP list and from NewForm.aspx, EditForm.aspx, and DispForm.aspx.
Using jQuery, populate that hidden field as such: $(":input[Title='fieldName']").val("1");
The using an SPD workflow, check to see if that field = 1. If so, run the workflow. AND at the end of that workflow set the field to 0 - that's important.

Resources