Dynamically Update Google Form 'Choose from list' options from RESTFUL Api - rest

Actually, I am trying to make a Google form in which I have 3 dropdown fields and their options which i need to dynamically populate/update.
1st Dropdown (Select Country)
2nd Dropdown (Select State / Province)
3rd Dropdown (Select City)
I have one restful (GET) API for getCountriesList, so what I need to do is when form load country dropdown will be filled after making getCountriesList API and then on the base of country selection, I have one more API to getCountryStates and that API will fill the state/provice dropdown. same as for city dropdown.
Actually, my main question is how to get triggers
form loaded
option selected from the country dropdown or state dropdown.
so I can call the APIs.

At this time the Google Form doesn't have an API, but Google Apps Script (GAS) has a service to handle forms. Unfortunately GAS doesn't have triggers for that. To learn about what triggers are available on GAS see https://developers.google.com/apps-script/guides/triggers.
You could try to "hack" (in the good way) the resulting form. This is easier by switching to the old Google Forms than with the new, because the old forms use "basic" html form tags and some "basic" JavaScript while the new Google Forms are a more complex and harder to "hack".
Related:
https://webapps.stackexchange.com/q/84633/88163
https://webapps.stackexchange.com/q/101730/88163

Related

Using spfx webparts, would there be a way to either programmatically send an email which has a link to open a modal or using flow?

I want an spfx made webpart that I've made be able to send an email (I'm using IEmailProperties at the moment) which provides a link to a modal form?
For example:
User clicks button in webpart, form loads.
User fills out form and submits it to SP list.
Form sends email on submission. Email has a link to the actual item created, so when the user clicks the provided email link, it opens up the modal form.
I would presume that the user would HAVE to be sent to the SP page where the webpart is unconditionally, but would it be possible to open up the modal corresponding to the SP list item?
Is this feature available in SharePoint framework, because if it isn't, compared to something like InfoPath 2013 or PowerApps it's quite a limitation.
I've researched this with several shallow Google searches and on gitHub for any premade stuff, but alas there is nothing that I've spotted.
I've been told IT IS possible:
"Yeah, they’d have to visit the page. Email clients don’t do JavaScript so you can’t really do interactive stuff there. If you want to take them directly to a page that then displays a modal, that’s plenty possible though. (e.g. display the modal based on if the URL contains a certain string)"
But wouldn't know how to do the above, can anyone start me on the right path?
Regards,
T
In the email, pass a query string containing the item ID/list ID etc of the item, then have the webpart read the See: How can I get query string values in JavaScript? If your values exist. If they do exist, then open the modal using some kind of framework like bootstrap or fluent UI. You can write your own form using PnPjs or use an iframe potentially to display the OOTB edit form.
Additionally, you can link to any page in SharePoint provided you use an extension instead of a webpart to host the modal. You can install extensions tenant wide, and have it listen for the query string.

Can I read a value from one SharePoint web part into the the form for a list in another web part?

I'm not sure if it's possible to do what I'm hoping, but maybe I'll get lucky. It has to do with setting form fields in a SharePoint 2010 list, using InfoPath forms.
Basically, I have one list with requests from several vendors. Each vendors has their own requests page which is a Web Part Page with one web part: a list of submissions with a custom view applied that filters it only to them. This is a (clunky but functional) way to ensure each vendor only sees their own requests. To submit a new request, they click on the "Add Item" link at the bottom of the list web part. At this point, a customized InfoPath form pops up, and they add their request.
In the form, one of the fields is "Vendor". What I would like to achieve is to have the InfoPath form read something on the page which tells it which vendor's page it was called from and pre-select that vendor (I could then disable the control so they couldn't change it). I am happy to alter the calling page as needed, or to configure the InfoPath form (can you custom-configure GET or POST values or anything to define a field that way?).
Any help would be very appreciated.

Using ninja forms, how can I persist field values across pages?

I have a form on the home page of quotedjobs.com that I would like to persist the field values of across pages.
For example: A user enters some values in fields, such as job title (textbox), job type (list) and job description (text field). Underneath that I ask users to register on the site, but they have the option to click a link to allow them to login if they are already members.
What I would like to be able to do, is to redirect users to another form that is a copy, but allows them to login instead of register, but keep hold of the values that they entered in the title, type and description form of the previous page so they aren't losing their work.
I have seen the ninja_forms_processing variable in the docs, but I'm not clear on how to use that.
TL;DR - You can't.
As it was slim pickings here, I sent an email over to support. Got this response:
Hello,
At this time this use case is not possible in Ninja Forms. The plugin is currently unable to transfer data from field to field or between forms.
I’m sorry that we do not have a better solution for you at this time.
Thank you,

Woocommerce - How can I create an order form/quote to be added to a cart?

I'm working for a client who prints on canvases, he needs the site to request the user's information/preferences of what kind of print job is to be done.
The user fills a form attaching an image of what should be printed on a canvas with predefined prices for different canvases or print surfaces of different sizes, on submission of the form, the fields of the form are transferred to the cart.
When an order has been placed, the user can checkout by paying for the products once ready.
I'm trying to recreate the order form here nifty250.co.za at the bottom of the page, exempting the Instagram login part.
I'm aware of a plugin like Gravity form with an add-on that might be able to do this, but I'm not sure it can do as I intend.
Products are actually a custom post type, so you can use wp_insert_post to insert a new product. After you insert, you get the id of the new product post type, use update_post_meta to set a meta key and meta value as _visibility and visible respectively. you can set the visibility also.
This answer shows how to insert product .
To add to cart
global $woocommerce;
$woocommerce->cart->add_to_cart( $product_id );

Updating list of <select> options dynamically

I work in Yii framework.
There is already done a form to edit person data.
Now we enter data for a contract about a pupil. Entering data about a pupil, we need among other to enter a list of his kins (parents and siblings).
The boss wants to add new items to <select> for a list of persons in the contract form without page reloading (in AJAX). That is he wants just to click "Add" button in the contract form and this button would open a form to enter data about a person (a kin of our pupil).
The question is how to implement it in a good (that is object oriented) way? There are already active forms to enter information about persons. What is the right way to "plug" a callback which updates the <select> in the contract form when we create a new person? Should this callback be called only if we open through the above mentioned "Add" button, or should it scan all open HTML windows and modify all "contract" pages (even if there is opened several contract pages)?
I make a shot to show up how it should work