Microsoft PowerAutomate Flow Response ID - sharepoint

I'm using the template 'Send an email to responder when response submitted in Microsoft Forms'.
So when an entry is made in Forms, the data is written to a List, and the responder receives an email with some confirmation information.
It all works as expected, except for when I want to include the ID of the request.
I have a column called ID in my List, which gets auto-generated for each entry made (this is standard functionality, I haven't created this).
Back to my flow; when I add the Dynamic Content of "Response ID" (which seems to be the only "ID" available) it isn't quite right.
For example, I've just entered a test record. It was assigned ID = 71 in List. But when the Flow email was triggered, the Response ID included in the body of the email was = 66.
Screenshot of data in my List:
Screenshot of email received:

The response id is the id of the response to the Microsoft form.
If you want to save the response to SharePoint List, you could use create item action.Then you could get the new list item.
My test flow for your reference:
Test result:
Updated:

Related

Remove 'Finish Later' button from DocuSign powerform

I am using Powerform for the digital signature. I have kept the return URL in the Destination URL section. But for the Finish later URL, is there any way to identify the user who kept the form for 'Finish later'? Eg: Adding an extra parameter, email of the user filling the form. So that, the user details can be updated in my DB system one the user redirect back to my website. Or, Is it possible to remove the 'Finish Later' button from the power form?
Thanks in Advance.
In my DocuSign account, I have added custom 'Merge Fields', 'sec1_email', and dragged and kept it in the email section in the PDF. In the destination URL I have added, ''http://localhost/proj/testform/?docustatus=completed&email=[[sec1_email]]' expecting, the sec1_email will replace the email id entered by the user in the form. Then once the user submit the form and the return URL became, 'http://localhost/proj/testform/?docustatus=completed&email=[[sec1_email]]'. The URL returned the same string instead of the dynamic value email. How can I replace the custom field value 'sec1_email' which was entered in the form by the user in the URL? (In template settings, When I add the merge filed, those added fields appear in the custom fields.)
You should be able to pass a unique variable in and out of the PowerForm via URL parameters. https://support.docusign.com/en/guides/ndse-user-guide-populate-custom-document-fields-in-a-web-powerform
Essentially you would want to create a custom field on the envelope, then pass in a unique identifier via the PowerForm URL. When the PowerForm completes or someone hits Finish Later, it goes to your designated landing page. These landing pages can also have parameters passed back through them. Essentially it would go from Finish Later > http://www.yourdomain.com/landingpage?customerUserId=uniqueIdentifier.
https://support.docusign.com/en/articles/How-do-I-specify-a-URL-to-redirect-to-when-a-Powerform-is-completed

Azure Logic app read my approval email in form of HTML tags

I have created a Azure Logic app to read the email body and check for the condition - If the email body 1st line has the only word called "Approved", then trigger another process or else do nothing.
But when performing it, I could see the condition gets to false even though the mail has only Approved word in it accommodated with signatures in the bottom. After researching, I could see the email is being read like HTML tags. So i created two more variable to extract a part of this e-mail and check for condition.
EmailBodyTrimmed = trim(substring(toUpper(replace(replace(trim(variables('EmailBody')),' ',''),'.',''),),0,500))
EmailBodyTrimmedFinal = trim(substring(trim(replace(trim(variables('EmailBodyTrimmed')),' ','')),0,indexOf(replace(variables('EmailBodyTrimmed'),' ',''),'<')))
But nothing seems to give correct answer. Can anyone help me ?
I think you can use Body Preview to receive the body of the email:
According to my test results, it receives the text in non-HTML format, so you don't have to extract the body from the HTML text.
Then you only need to add a condition and use starts with to determine whether it starts with approved.
Of course, this premise is that your email body is in plain text format, if it is in excel format, you need to do other processing.

Setting up Gmail Push Notification for a specific email having attachments

I am trying to set up Gmail Push Notification to create a watch request for any new email received in the INBOX. So far, this is fine. However, I am trying to create a watch request as described here :
https://developers.google.com/gmail/api/guides/push#getting_gmail_mailbox_updates
I would like to set up a watch request for any email received from a specific email(info#abc.com) address having a subject line "[Important]" and having a PDF attachment.
Any idea if such a watch request can be set up?
Currently, I am reading all the emails from INBOX using imaplib received in the last 24 hours and manually search for emails having the subject line and attachment. However, I believe, this solution is not ideal.
Issue:
The only filter you can apply to Gmail Push Notifications is which label/s to retrieve notifications from, as can be seen here. Because of this, the filtering of messages depending on (1) who sent the message, (2) the email subject and (3) whether the email has a certain PDF attachment cannot be done at this stage, but after receiving the notifications. Luckily, though, there is no need to look for these messages manually, you can code your application to do that for you.
Workflow:
- Step #1. Set notifications for all INBOX and retrieve startHistoryId: As was said before, you have to receive notifications for all INBOX, since there is no more specific filter available. A call to Users: watch, providing INBOX in the labelIds field and the topic you created in topicName, will effectively configure the notifications. The response to watch has this shape:
{
historyId: 1234567890
expiration: 1431990098200
}
Where historyId refers to the mailbox’s current state. Let’s store it somewhere, and call it startHistoryId.
- Step #2. Get INBOX changes: After completing step 1, whenever there is a change in your INBOX, your application will receive a notification message describing the change. Whenever a notification is received, you want to get information about the specific changes made to the INBOX, and to achieve that, you should call history.list().
That is to say, your application should call history.list() every time a notification is received. Now, you want to get changes since last time, and that’s why you should provide the historyId retrieved in step 1 as the parameter startHistoryId. If you want to only retrieve new messages (and not deletions, or label edition/removal), you can set historyTypes to messageAdded. The request could be like this:
{
userId: “your-email-address”,
historyTypes: “messageAdded”,
startHistoryId: “your-start-history-id”
}
As a response, you’ll get something like this:
{
"history": [
{
"id": unsigned long,
"messages": [
users.messages Resource
],
"messagesAdded": [
{
"message": users.messages Resource
}
]
}
],
"nextPageToken": string,
"historyId": unsigned long
}
Here, you should retrieve historyId, which will be used as startHistoryId the next time history.list() is called, and messagesAdded, which contains the IDs of the new messages you want to look for (only ID and threadId seem to be populated).
- Step 3. Filtering messages: Now you have the list of message IDs that have changed since last time (messagesAdded), and you want to know which of them match your criteria. To know that, you’ll have to iterate through all IDs in messagesAdded and call Users.messages: get for each ID. This will return the corresponding message resource. For each message, you’ll have to check whether the criteria are met:
Sender email: inside the resource, access the headers (message[“payload”][“headers”]), and loop through them, looking for the one whose name is From. You have to check whether the corresponding value is the email you’re looking for.
Subject: as in step (a), access the headers and look for the header whose name is Subject. The corresponding value is the email subject. Check whether it starts with [Important].
Attachment: you’ll have to look for the email attachments in message[“payload”][“parts”]. The process is a bit more complicated, but see, for example, this related question.
Reference:
Gmail API: Push Notifications

Using Graph API to query SharePoint list items and expand user field

I'm trying to query for some SP list items, all is working fine except I can't seem to expand a custom column of type Person.
I can see the createdBy and lastModifiedBy expanded and even includes the AAD user id, which is great and also leads me to think what I want is possible!
But mine is a custom column.
I'm running this and can only seem to get the SP user list id and the user's display name...neither of which are much use.
/items?expand=fields(select=UserLookupId,User)
Ideally I'd like to get the AAD user id as per createdBy and modifiedBy field, but the email would suffice.
Otherwise the only way I can see is to query the User Information List (using the UserLookupId) to get the email?
Thanks
This appears to be correct assumption:
Otherwise the only way I can see is to query the User Information List
(using the UserLookupId) to get the email?
for non-system user fields, it is indeed a way to go, but there are some distinctions whether user field is multi-valued or single-valued.
If Approvers is a multi-valued user field, then the following query:
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?$expand=fields($select=Approvers)
returns email and id properties along with displayName property for user field value.
While for single-valued user field only id (available via {userfield}LookupId property) and displayName properties could be requested via items endpoint, for example:
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?$expand=fields($select=Approver,ApproverLookupId)
So, indeed User Information List needs to be utilized to request additional user properties, for example:
https://graph.microsoft.com/v1.0/sites/root/lists('User Information List')/items/{item-id}/?$expand=fields($select=Email)
where item-id corresponds to user field lookup id
This was my experience modifying the
Build Angular single-page apps with Microsoft Graph. In the examples below, I changed my id's out with the default text.
Here is
The Finished Project on thier github
In Graph Explorer, this worked. You can verify it at the Microsoft Graph Explorer.
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?expand=fields($select=id,Title)
In the app/graph.service.ts in the app, this did not work. Even though you would expect it to based on the graph explorer.
.api('/sites/{site-id}/lists/{list-id}/items?fields($select=id,Title)')
Changing the app/graph.service.ts api call worked.
.api('/sites/{site-id}/lists/{list-id}/items?')
.expand('fields($select=id,Title)')
The result looked like this:
fields: {
#odata.etag: ""d6f5b6ea-9f90-452d-98ba-e838f58d3359,1"",
Title: "IT SPECIALIST (MID)",
id: "20"
}
Here's an example site id:
some.sharepoint.com,9dk062b-2e54-4e4f-b71a-cdb74f42cc44,c6cf6b0a-cc7c-41fd-a76a-ef8f97e8a22f
Here's an example list id.
8eg8c29a-5555-4cfc-bfa4-0e907488f781
The end url won't have any {} in it.

Changing the email body for transactions sent as a PDF attachment

When a Sales Order is emailed to a customer with Email Preference set to PDF, the body of the email reads:
Please open the attached file to view your Sales Order.
To view the attachment, you first need the free Adobe Acrobat Reader. If you don't have it yet, visit Adobe's Web site http://www.adobe.com/products/acrobat/readstep.html to download it.[/CODE]
I'd like to add onto this message a bit. I think that will require me to write a script that renders the transaction to a PDF template and sends the email with whatever message I choose. It also needs to prevent NetSuite from sending the default email as well.
Would the following work:
In a beforeSubmit function on Sales Order records, if the customer has Email Preference=PDF, uncheck the 'Email To' field. Set a new custom checkbox such as 'Email PDF' to true instead.
In a User Event Script, after a Sales Order submits and has 'Email PDF' set to true, render the transaction to a PDF and send it in an email to all the 'Email To' recipients.
Or is there a better solution I may be overlooking?
The 'duplicate question' says this can't be done yet I have a working solution. It also references SuiteTalk, not the same.
This is a solution someone gave me on the official NetSuite forum:
You can accomplish this fairly easily with a Workflow.
- Trigger on Before Record Submit when 'To Be E-mailed' = T
- Set Field Value of 'To Be E-mailed' = F
- Transition to next state After Record Submit
- Use 'Send Email' action. This allows you to use an email template and
also automatically attach pdf

Resources