cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ClaireAllen
Post Prodigy
Post Prodigy

update SharePoint list with reply from an email

Hello,

 

Help required please,

 

I am in the process of building a flow, where I would like to update a list item with some information received in an email.

 

The workflow currently has a substring to get the subject without the RE: 

 

I would like to try and get the Job Reference from the Body of the email and update a SharePoint list with this information,

Any suggestions on how I can achieve this?

This is what I currently have, the ID is the Substring Output to remove the RE:

Update Item.JPG

@ChristianAbata , kindly helped with the Substring, are you able to show me how this would work?

 

Thank you for your help,

 

Kind regards

 

Claire Allen

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hello @ClaireAllen 

Why don't you use the ID value of the SharePoint item you get in the "Get item" action instead of using the substring value? With the information provided I don't know if the failure is in the ID field or in the other ones...

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

View solution in original post

Hello @ClaireAllen 

Sorry, I forgot the reference the body of the response. The expression should be:

split(outputs('Html_to_text')?['body'],' ')[2]

Hope it helps!

Ferran 

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

View solution in original post

30 REPLIES 30
v-alzhan-msft
Community Support
Community Support

Hi @ClaireAllen ,

 

What is the issue for your flow?

Could you please share the screenshot of the run history of your flow when it has run failed?

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-alzhan-msft ,

 

Thank you for coming back to me, this is the error that I receive

Update item Error.JPG

@ChristianAbata , kindly helped me solve the issue I was having with the substring in the Subject line to remove the RE:,

 

When I trigger the workflow it does not work, I have tried to create a new output, this did not work either, not sure what action I should be taking to get the item to update in a SharePoint list.

 

Kind regards

 

Claire

Hello @ClaireAllen 

 

It would be very helpful if you could share the flow with us (a screenshot) and which is the ouput of the substring function. It seems like it is trying to update a string column with a wrong format or value.

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Hello @fchopo 

 

The substring that @ChristianAbata  kindly helped me with is working okay,  the flow moves to get items but stops at Update Item.

Substring.png

I now need to get the update item working so that I can pull data from the body of the email, this is where the flow fails.

For example:

When the reply comes back in via email, I would like to get the Job Reference from the Body of the email and update that column in the SharePoint list, this is what I am currently having issues with and not sure how I get this fixed.

 

Thank you for your help.

 

Kind regards

Claire

Hello @ClaireAllen 

Why don't you use the ID value of the SharePoint item you get in the "Get item" action instead of using the substring value? With the information provided I don't know if the failure is in the ID field or in the other ones...

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Hello @fchopo 

 

I'm not sure if the link to a previous discussion that I have been having with @ChristianAbata  will help understand my requirements.

 

I will try your suggestion and see how I get on.

 

Thank you for your assistance,

 

Kind regards

Claire

Hello @fchopo 

 

I have tried your solution and changed the substring to the Get item ID and this worked, Thank you

update item - ID.JPG

 

The only issue now is the response in the SharePoint List, I would like only to see the Job Reference, instead of all content as shown,
Is there a way to remove this and only show the information required?

update list item.JPG

I now feel this is so close, I really appreciate your help,

 

Kind regards

Claire

 

 

Hello @ClaireAllen 

Which is the value that should be displayed in the "Job reference" field? I unerstand that it is in the body of the email, but which is the format or information in the body? Could you give an example, please?

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Hello @fchopo ,

 

I would like just to see the number of the Job Reference i.e. 123456

 

Kind regards

 

Claire

 

Hello @ClaireAllen 

If the body content is always in the same format (booking reference: XXXXXX....), we could try to remove some parts of it using substring expressions, but if it is not, then it's not going to be possible to get it. Is it always in this format?

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Hello @fchopo ,

 

We can make it to be a set format to get the workflow to do what we require,

 

Is this something you can help with?

 

Thank you & regards

Claire

 

Yes, but in any case, have a look at some resources like the following:

 

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Hello @fchopo ,

 

I had a look at some of the options available, thank you,

 

but the workflow is now failing at the update item

I followed the steps and added the following to my flow

Html to text.JPG

Compose Length Body.JPGIndex of Body.png

 

In the compose three I want to pull the Job Reference, I've tried various numbers at the end and no matter what I put in the workflow fails, I started with 13 for Job Reference

this is the error message I now get

 

update item error.JPG

I am not sure what I am doing wrong and how to correct it, any help would be appreciated,

 

Kind regards

Claire

 

Hello @ClaireAllen 

In order to help you, it would be great if you can share the output values of the different values. For example, which is the output of the "Compose 3 - Job reference" action? You can see the output values when you execute the flow.

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Hello @fchopo 

 

Hopefully I have provided all of the information you require to help,

output - Html to Text.JPGoutput - Compose 2.JPGoutput - Compose 3.JPGoutput - Get item Error_1.JPGoutput - Get item Error.JPG

Thank you for your assistance,

 

Kind regards

 

Claire Allen

Hello @ClaireAllen 

OK! To get the job reference you could try to use the split function. In the "Update Item" action, could you add this expression to the "Job Reference" field?

 

split(outputs('Html_to_text'),' ')[2]

 

This expression will create an array of elements based on the output of the "Html To Text" action, separating them by the white space character. So, the string "Job Reference 123456 ....." will be converted to ['Job', 'Reference', '123456', .....], and therefore we get the 2nd element (the array starts at 0).

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Hello @ClaireAllen 

Did you solve your problem? Was useful the proposed solution?

Regards,

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Hello @fchopo ,

 

Unfortunately not, I was trying to understand the error on the web address in the error message before coming back to you, but I could not work it out.

 

This is what I put in the update item expression

Update Item Expression.JPG

 

This is the error that I received

Update Item error.JPG

 

Kind regards

 

Claire

Hello @ClaireAllen 

Sorry, I forgot the reference the body of the response. The expression should be:

split(outputs('Html_to_text')?['body'],' ')[2]

Hope it helps!

Ferran 

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,963)