Either / Or "Optional" Required Fields in Zapier - forms

I am making an Action in Zapier for my App.
I have two fields where only one needs to be filled.
For eg: The user can either enter the email or phoneNumber but not both.
So I cant use the 'Required' attribute because it will ask user to enter both.
I couldnt find a solution in the Zapier Documentation also.
Kindly Help
Thanks

David from the Zapier Platform team here.
The best way to do this is mark neither field as required, but include help text for each field that mentions that either one or the other is needed.
Then, before you make your request, verify that a || b is true. If it's not, throw an error telling the user they have to supply either.
Hope that clears it up!

Related

dialog flow skipping a parameter based on another parameter

I created an intent for my item selling store with name "Order". I want to ask user if he wants the item to be picked up or get delivered.
if he is picking up then i do not need to capture his address. In my current implementation I created two required paramaters named "OrderType" and "deliveryAddress"
so the question is how do i skip deliveryAddress capture if value of OrderType is pickup ?
Please note that I am using fb messenger as a channel so the value of orderType would be coming from FB.
Wanted to put this as a comment but do not have 50 reps required for commenting.
Hence putting this as an answer though it is just a workaround and not the right solution.
I had faced a similar issue and achieved it by giving a default value to the required parameter. And then comparing in my fulfillment logic whether the value is default or else it would have been via user input. Not the right way but just a work around if no one replies with the right solution.

In Facebook messenger API, how to prevent button postback payload text from being logged to chat window on click?

TLDR; # bottom
I asked the following question in the Facebook bugs section
NOTE: This is more of a platform design suggestion than a bug, as I failed to find a Chat API feedback portal
Currently I'm building a Chat bot that allows the user to track a goal. It will say something like "Did you go for a walk on July 12, 2016 ?" and have Yes/NO buttons below.
Currently in order to pass the intent, the day and the achievement boolean I need to template a string like this "==GOAL== achieved? <<<{goal_achieved}>>>, date tracked [[[{date_tracked}]]]" and use regex to capture the delimited variables. This is prone to parsing error in other cases where the templated strings in the payload are user-input variables i.e. if the '{goal_achieved}' were replaced with the goal variable '>>meditated" then the regex that captures the templated variable could fail.
One could use the postback payload to store a JSON-encoded string but the problem with this is that the payload string gets logged into the user output and JSON strings are a bit ugly and confusing. The challenges I face could be easily remedied if the payload was not logged to the user Instead log the text for the button to help the user confirm the button was clicked.
If that is not possible, is there any other advice for encoding data into button payload ?
The following answer was offered (Mark Wiltse)
Hi Justin,
Unfortunately at this time our payload structure does not support the functionality that you are trying to implement. From my understanding you want to use the Payload to inform your backend if the user accomplished their 'goal' on that specific date. I would suggest that you create your payload response for the button on your end before passing it to us, which is basically the JSON idea that you had initially.
I know this is a bit cumbersome to handle but the payload response passed back is independent of the text that was provided with the messenger thread.
I would suggest that you also attempt to sanitize your strings if you are worried a user has previously provided you would cause an issue with your regex. You should be able to implement this functionality if the prior user data is sanitized to avoid any issues with regex/json parsing.
Since this is an implementation question I will have to close this report as Invalid. If you are still looking for additional insights and concrete tips for implementing this flow please post to our stack overflow where we have Facebook Engineers and a wide range of community members who also contribute.
http://facebook.stackoverflow.com/
Take care and best wishes with your messenger bot.
Mark
This sentence was particularly unclear:
I know this is a bit cumbersome to handle but the payload response
passed back is independent of the text that was provided with the
messenger thread.
TLDR;
Can anyone inform me of how to prevent the button from logging the payload string so that I can use it to pass JSON to my app without the user seeing it ?
Make sure to comment out sendTextMessage() in your receivedPostback() call :
function receivedPostback(event){
sendTextMessage(senderID, event.postback.payload);
}
From my understanding you're saying that when you press a button the PAYLOAD instead of the button's text is showing up.
Are you defining your buttons like this?
{
type: "postback",
title: "View Details",
payload: "details:12345"
}
I'd recommend removing any special characters that would mess with the parsing of your payload. As long as the special characters are not crucial to the user experience this is probably a fine solution.
If this doesn't solve your issue:
Can you add a screenshot showing the button you are pressing, and the log message you are talking about? From my understanding you're saying that when you press a button the PAYLOAD instead of the button's text is showing up. That's not the case for me, my buttons text shows up when I press a button.

Custom tags in Jira email handler

Is there a way to make a Jire email handler ignore the From field in an email and go for a custom tag instead? I know I could work with the API instead but that's in the pipe. this is a temporary solution that will be used until a more robust system is built.
To clarify what we have today:
Email is sent to inbox, (hr#company.com)
Jira picks is up and creates an issue.
Jira looks at the From field and creates a uses if none exist.
What we're trying to achieve:
Form is filled out, and an area is chosen (hr, facilities etc.).
Form is posted to an API that creates an email (basically a no-reply adress over SMTP) and sends it to the appropriate inbox (for example hr#company.com).
Email lands in the inbox and Jira looks in it and creates an issue in project or label 'HR'.
Jira now looks in the email and finds custom tags named [user] and [user-email] (or something) and creates a user from the tag.
Example email
From: no-reply#company.com
To: hr#company.com
Subject: Some problem
Body: Explanation of problem
Have a good day!
/Mike
[user:"Michael Smith"]
[userEmail:"michael.smith#company.com"]
If we were to implement this system now, we would loose the possibility to create new users because all emails would come from the same "no-reply" adress.
I have searched in the Atlassian forums and such, but with no luck. Have not found anything in the official documentation, but I fear that I might be looking in the wrong place.
I hope that I'm being clear, and that someone has any idea if it is possible.
Thank you!
You need to write your own plugin and create your own Mailhandler.
For example you can use a regex which looks for the tag
[userEmail:"michael.smith#company.com"] and retrieve the emailadress from the string. Do the same for the [user]-tag, if the user doesn't exist.
Here is a tutorial that shows how to create and setup custom Message Handlers:
https://developer.atlassian.com/jiradev/jira-platform/guides/email/tutorial-custom-message-mail-handler-for-jira#Tutorial-Custommessage(mail)handlerforJIRA-Step7:Implementarealmessagehandlerback-end
The rest should be easy from here.

PayPal not Prepopulating All Form Fields

I'm using the variables found on this page: https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/#id08A6HI0J0VU
to try to pre-populate the form data for buyers when they purchase things on my site. The trouble is, some of the fields are getting filled in, while others are not. First name, last name, telephone number, and email address work without a problem.
However, the country is always set to the USA, and address1, address2, city, and zip are left blank. I'm sure my code is correct. I'm currently using the sandbox for testing. Has anyone else experienced this problem and can tell me what the solution is? Any help would be appreciated.
Make sure you pass over all the address fields. If you do not pass over one of the variables, the address will not be displayed. If this still does not work, can you provide an example of what you are sending over and list what is not getting displayed when you test this and I will look into it further. However, make sure you are passing over all of the address fields.

Tagging a user in a wall post/update using Facebook API

I'm using stream.publish to write to the user's wall and attempted to get "# tagging" to work but with no avail.
If the user's name is Fred and his uid is 1234, I tried sending over "#Fred", "#1234", "#[1234]", "#[Fred]", etc. and couldn't get it to work. The raw string would display every time.
Can someone confirm if this is possible with the API or not? Thanks!
the correct syntax is
#[user_id:1:name]
it shows as a tag, but it doesn't trigger a notification. Anyone knows why?
Maybe you need follow this: NOTE: You cannot specify this field without also specifying a place.
You need to specify a place with the fan page ID of the location associated with the post.
moreā€¦ https://developers.facebook.com/docs/reference/api/user/#posts
reese:
#[user_id:1:name] - It will replace it with the 'name' which you have given
#[user_id:0] - This will notify the user BUT it will happen when you MANUALLY typing it in wall or comment section NOT through graph api, say for eg., if you want to notify this user #[user_id:0] so you are appending this text in message parameter of https://graph.facebook.com/feed api it won't work, I hope you understand :)