cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Flow Error

I created a flow to import information from an excel spreadsheet to a SharePoint list. There is a column that has yes or no options and I am receiving an error for my expression. 

 

I used if(equals(variables('str'),'Yes'),true,false) but I am still receiving any error message. 

 

Any help will be appreciated! 

1 ACCEPTED SOLUTION

Accepted Solutions
ccc333ab
Solution Sage
Solution Sage

1. Check to see if you have any items being retrieved out of your Get Items step. If you are not you need to troubleshoot your filter query in there. 

2. If you are getting results, then check to see if your condition is working correctly.

  • Does the item exist in both the SharePoint and Excel file, and if so then it should be going to an update. Does it go to the update (yes) side?  
  • Or if the item is a new item in the Excel file, then it should go to the create? So does it go to the create (no) side? 

If this isn't working then you have to troubleshoot why its not working. 

 

3. If that is working correctly, then check your create/update statements. For update: 

  • Are you using the right ID value in the ID field? This would be the actual ID, not DisciplineID. 

 

If you are getting results, 

View solution in original post

46 REPLIES 46
ccc333ab
Solution Sage
Solution Sage

It would be best if you displayed your flow and what the error message you are receiving to help troubleshoot this.

Anonymous
Not applicable

 

Let me know if you need additional information!

ccc333ab
Solution Sage
Solution Sage

Couple of things:

1. You also have an error in your apply to each expression. What are you doing in that action?

2. In your expression you use variables('str') but you have no variables initiated in your flow. What is 'str' and where are you trying to grab that from? 

Anonymous
Not applicable

I believe the only thing that I have in the "apply to each" section is the "excel value" I was trying to pull from the excel spreadsheet from the previous step.

 

The string is a single column in the spreadsheet that I am trying to pull from. For "grievance" column and "arbitration" column in the spreadsheet they are yes or no options. The original error was that it needed to be in boolean format so that is why I put that formula in. 

 

My overall goal is to pull data from each column in an excel spreadsheet into a SharePoint list. 

Hope this helps! 

 

ccc333ab
Solution Sage
Solution Sage

To clarify my answer, I have made the following assumptions: 

  • In Excel, your spreadsheet columns "Grievance" and "Arbitration" will have the words yes or no as data
  • In SharePoint, your fields "Grievance" and "Arbitration" are of data type yes/no

Then what you need to do is to use your expression, but replace the variables('str') with your fields (assuming you are cutting/pasting this from someone else's solution that has a variable called 'str'). 

 

So it would be if(equals(items('Apply_to_each')?['Grievance'], 'Yes'), true, false) and if(equals(items('Apply_to_each')?['Arbitration'], 'Yes'), true, false).

 

Not sure in your screenshot if you left the Excel values in there for an example, but the only thing should be the expression: 

ccc333ab_0-1624978747922.png

 

Anonymous
Not applicable

I made the changes above and received these error messages.

 

 

 

ccc333ab
Solution Sage
Solution Sage

I can't see in your any of your screenshots, but do you have something called "Documentation" in your list? That is what is throwing this error as whatever you are feeding into it is not a "string". 

Anonymous
Not applicable

Yes Documentation is a column that will have hyperlinks to PDFs. How would I fix that?

ccc333ab
Solution Sage
Solution Sage

Couple of questions: 

1. Are you able to show how you have this configured?

2. Is the data coming from Excel? If yes, what is in the excel file for this column that could possibly not be a string? What do you have in this column? 

 

Anonymous
Not applicable

Please see the screenshot below of how I have the spreadsheet set up. The link takes you directly to a word document.

 

 

2. All of the data is coming from excel, I am not sure which one wouldn't be a string?

ccc333ab
Solution Sage
Solution Sage

OK. I understand now. There are a few ways to address this from easy to complex. 

 

The Issue

  • You are using, ummmm, I don't know what to call it but its the hyperlink feature in Excel when you click in Insert Hyperlink, and you can give it the name and the address. Allows you to hide the URL and show a user friendly name. 
  • The problem here is that the Get Items will only pull back the name of the file (in the example you sent me, it brings back "Document Test.xlsx"). It knows NOTHING about the URL at all. 
  • What I didn't realize from the error message is that you are feeding this text into a column in SharePoint that has been set as data type "Hyperlink" (not sure why I didn't think that but the error message lead me astray). 
  • So you get an error because "Document Test.xlsx" is not in the format of a hyperlink. 

 

Easy/Quick Fix

If you don't mind, can you just use the URL itself in Documents column in Excel (http://something.com...). If you use that, that should work when adding it to SharePoint.  The problem with this approach is it'll show the URL not the name of the document. 

 

More Complex Fix: 

To have a user-friendly name showing, you will need to have both a column for that and the URL (so you'll need an extra column). So something like: 

DocumentsNameDocumentsURL
Documents1.docxhttp://something.com/documents1.docx

 

Then you can then update the column in SharePoint with an HTTP Request (not as part of your create item action). 

 

This article will explain how to do that, but of note, in the HTTP body: Where it says: 

  • "Description": "Microsoft" insted you would use the DocumentsName column
  • "Url": "https://www.microsoft.com" you would use the DocumentsURL column. 
Anonymous
Not applicable

Good news and bad news..

 

Good news, looks like we fixed the document hyperlink issue.

 

Bad news, I have a new error. The specified user Doe, Jane could not be found.
clientRequestId: 092a59a0-9bfa-458f-81ac-a594ef95266b
serviceRequestId: 092a59a0-9bfa-458f-81ac-a594ef95266b

 

 

Jane Doe is a dummy employee name. 

ccc333ab
Solution Sage
Solution Sage

Firstly, you cannot insert a dummy name into your list. You are using a "Person/Group" data type, and SharePoint will check against your AD to see if the person exists. So you can only use legitimate users. If you want to use users without this check, make this field a string field instead. 

 

Secondly, if keeping with the Person/Group data type, when using your "Employee Name Claims" field (and Supervisor Name Claims), you will have to pass in their email address. 

Anonymous
Not applicable

How do I make the field a string?

ccc333ab
Solution Sage
Solution Sage

What I meant was to make your column in SharePoint be of data type "string". Then you can put anything you want in that column...doesn't have to be a specific person in your system. 

Anonymous
Not applicable

Okay!  I think that fixed it.

 

Another error message...Object must implement IConvertible.
clientRequestId: de1d838a-ebdb-49f6-8175-096a29c7fc13
serviceRequestId: de1d838a-ebdb-49f6-8175-096a29c7fc13

 

 

 

ccc333ab
Solution Sage
Solution Sage

That's a new error message for me with the Create Item action. Did a quick search and this was the only solution I could find (basically recreate the flow). 

 

If your flow isn't too big, you can do that, however, what I might try is to delete out a few of the fields you are adding to SharePoint and until your flow works. Then keep adding additional fields until you can find the one that is causing this issue...at least then, we can pinpoint down to the object that is causing this issue. 

Anonymous
Not applicable

Flow was a success! Thank you.

 

Last question....Do you know how to stop it from duplicating?

ccc333ab
Solution Sage
Solution Sage

Glad to hear it is working. 

 

As for stopping duplication? What do you mean exactly? Its creating duplicate records in SharePoint? Can you

  • Show me a screen shot of what is currently in your Apply_to_each loop
  • Show me a run of your flow, focusing on inside your Apply_to_each loop
  • How many rows is currently in your spreadsheet you are using to test this

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 (5,822)