cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Claudiu
Helper I
Helper I

Get O365 Messages

Hello,

 

I am trying to get the O365 Messages into a SharePoint List but I receive an error, and I cannot find any solution.

 

Can you please help me ?

1 ACCEPTED SOLUTION

Accepted Solutions
v-yujincui-msft
Community Support
Community Support
17 REPLIES 17
Claudiu
Helper I
Helper I

error.PNGflow.PNG

v-yujincui-msft
Community Support
Community Support

Hi @Claudiu ,

 

Could you please provide the outputs of the ReadMessages Action?

It seems that not an array, Apply to each Action requires an array as input.

 

Based on the screenshots you provided, maybe you could try using the expressions like this:

outputs('ReadMessages')?['body']?['Id']
outputs('ReadMessages')?['body']?['Messages']

 

vyujincuimsft_0-1646297598724.png

 

 

Best Regards,

Charlie Choi

Claudiu
Helper I
Helper I

Thank you for your response and for your time.

 

I am receiving now this error : 

 

test.PNGtest2.PNG

v-yujincui-msft
Community Support
Community Support

Hi @Claudiu ,

 

If it is convenient, could you post the outputs of the ReadMessages Action in the reply? Taking care to change the sensitive information to other values.

 

Best Regards,

Charlie Choi

Claudiu
Helper I
Helper I

I can show you the output from the custom connector that I made : 

output.PNG

The output is the same but raw data.

v-yujincui-msft
Community Support
Community Support

Hi @Claudiu ,

 

Try to use the following expressions:

outputs('ReadMessages')?['body/value']?['Id']
outputs('ReadMessages')?['body/value']?['Messages']

or

outputs('ReadMessages')?['Body/value']?['Id']
outputs('ReadMessages')?['Body/value']?['Messages']

 

Best Regards,

Charlie Choi

test.PNG

v-yujincui-msft
Community Support
Community Support

Hi @Claudiu ,

 

You can select the dynamic content 'Body' , so can you select the dynamic content 'value' ?

If so, you could try to use value as the input to the 'Apply to each' Action.

vyujincuimsft_0-1646364296110.png

If not, you could try to use the following expression:

 

outputs('ReadMessages')?['Body/value']
item()?['id']

 

vyujincuimsft_3-1646365287773.png

In addition, you could add a Compose Action to check if the outputs is correct.

 

Best Regards,

Charlie Choi

 

Claudiu
Helper I
Helper I

I really appreciate this help.

1.PNG

2.PNG

v-yujincui-msft
Community Support
Community Support

Hi @Claudiu ,

 

Could you please provide your expressions? The function 'item()' must not have any parameters.

vyujincuimsft_0-1646375103589.png

item()?['id']   √

item('id')       ×

 

Best Regards,

Charlie Choi

 

 

Claudiu
Helper I
Helper I

For the Apply to each i use :  outputs('ReadMessages')?['Body/value']

For Compose i have  item('ReadMessages')?['Body/value']

And for Condition i use item()?['id']

v-yujincui-msft
Community Support
Community Support

Yes , you are right ,thank you , now is working.

 

But if i am trying now to add a CREATE ITEM in SharePoint list , i cannot find any Dynamic Content for exemple like ID or StartDate 

 

1.PNG

v-yujincui-msft
Community Support
Community Support

Hi @Claudiu ,

 

You could get their values by writing expressions as before:

item()?['FieldName']
item()?['id']
item()?['startDateTime']

vyujincuimsft_0-1646379857667.png

 

Best Regards,

Charlie Choi

Claudiu
Helper I
Helper I

Thank you for your information and your time @v-yujincui-msft . The issue is solved.

Claudiu
Helper I
Helper I

@v-yujincui-msft one more question, I am sorry.

I am trying to get also the content from the body using the same format  item()?['content'] but in the SharePoint list is not added.

1.PNG

 

v-yujincui-msft
Community Support
Community Support

Hi @Claudiu ,

 

Try to use the following formula:

item()?['body']?['content']

 

Best Regards,

Charlie Choi

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (2,266)