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,
It would be best if you displayed your flow and what the error message you are receiving to help troubleshoot this.
Let me know if you need additional information!
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 made the changes above and received these error messages.
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".
Yes Documentation is a column that will have hyperlinks to PDFs. How would I fix that?
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.
The Issue
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:
DocumentsName | DocumentsURL |
Documents1.docx | http://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:
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.
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.
How do I make the field a string?
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.
clientRequestId: de1d838a-ebdb-49f6-8175-096a29c7fc13
serviceRequestId: de1d838a-ebdb-49f6-8175-096a29c7fc13
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.
Flow was a success! Thank you.
Last question....Do you know how to stop it from duplicating?
Glad to hear it is working.
As for stopping duplication? What do you mean exactly? Its creating duplicate records in SharePoint? Can you
User | Count |
---|---|
88 | |
43 | |
21 | |
18 | |
16 |
User | Count |
---|---|
132 | |
47 | |
42 | |
36 | |
28 |