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!
Solved! Go to Solution.
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.
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:
If you are getting results,
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?
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!
To clarify my answer, I have made the following assumptions:
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:
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".
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?
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?
OK. I understand now. There are a few ways to address this from easy to complex.
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:
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:
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.
Jane Doe is a dummy employee name.
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.
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.
Okay! I think that fixed it.
Another error message...Object must implement IConvertible.
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.
Glad to hear it is working.
As for stopping duplication? What do you mean exactly? Its creating duplicate records in SharePoint? Can you
Keep up to date with current events and community announcements in the Power Automate community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!