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

Change to user().email now formulas not working

 Hello,

 

I just realized I coulse use user().email instead of a drop down choice so I changed out that user input area and now nothing works. 

 

The following is my order of operations before the error. 

  1. change the choice input to a text input (single-line) and changing the default to user().email
  2. Error
  3. Change column in sharepoint from choice to single-line text
  4. (From here is saved in a collection for review before submitting)
  5. Submit button does not work. It is in the collection. I can see it there, but it is not uploading to sharepoint list.
  6. Change sharepoint column name so it is no longer the same as the text input. 
  7. Error
  8. Everywhere in my powerapp that uses this "SubmittedBy" has an error now. 

 

I was thinking it might be because user().email may not be considered a "single-line" text format? 

 

AddDetail = My Collection Name

'Test List' = my Sharepoint List

 

 

submit error.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions

I finally got it! At first it did not work BUT

  1. I found all code referencing my collection and \\made it a note.
  2. I deleted the input box for my "Submitted By"
  3. I deleted the coding calling out the "Submitted By"
  4. Then I deleted the column in sharepoint list 
  5. Saved and closed List and PowerApps
  6. Restarted List and PowerApps
  7. Remade the column as a text (orginally I tried just editing the column but it did not seem to take, even after a refresh)
  8. Refreshed Data Source in PowerApps
  9. Deleted \\from the code refernecing the collection
  10. Put input box for "Submitted By" with text wrap Text(User().email))
  11. Typed back in the all code calling out the "Submitted By"

View solution in original post

4 REPLIES 4
Isa_Watanabe
Frequent Visitor

Hi jbaggett,

 

This is how I typically troubleshoot Patching issues when a field type changes:

  1. Refresh your data source (View > Data Sources)
  2. Identify which fields are mandatory in your SharePoint 'List Settings'
  3. Reduce your Patch function within the ForAll to include only the required fields. Test
    • If it fails, you have either missed a required field or the data type for 1 or more required fields is incorrect. In this instance use the Value() or Text() functions to make the corrections.
    • If it succeeds, then your issue is with a non-required field
  4. Add your non-required fields one-by-one until it fails again
  5. Let's assume your issue is with the Submitted field (which is now a single-line text field) and the user().email input.
  6. Check your collection to make sure that your collection is storing user().email to the SubmitedBy column in the collection correctly. A way to test this is to create a label and make the text property the SubmittedBy of a single row of your collection, add a period to make sure no other properties are being returned: i.e. AddDetail[@SubmittedBy].?????
  7. Assuming that there is nothing you can select after adding the period, you have a Text field.

If this does not resolve your issues, consider removing the ForAll and patching a single line instead. If that still does not work, please send the error messages.

Hello, 

 

Thanks for the response! Unfortunately I'm still having issues. 

  1. I did refresh the data source
  2. The amandatory fields in my sharepoint are the submittedby and SO. 
  3. I did reduce the patch function to only the two fields and the issue still happened. (See picture below).
  4. I have not added in my non required fields yet
  5. the issue does seem to be the user().email
  6. My collection looks to be storing the email as a record. Am I able to upload a record into a sharepoint column formatted as a single line text? I tried to convert it within the formula useing Text() and it didn't not work. I did create a labled and it is respondig correctly with the email. 

Collection showing recordCollection showing recordPatch with only required inputsPatch with only required inputs

That is definitely your issue! You cannot write a record to a text field in SharePoint. I would recommend removing your original collection (and creating a new one) since the data type is set as a record for the SubmittedBy column.

When creating your new collection wrap User().Email using Text().... i.e. Text(User().Email).

 

After your collection is created, double-check to make sure that your SubmittedBy column is not a record.

I finally got it! At first it did not work BUT

  1. I found all code referencing my collection and \\made it a note.
  2. I deleted the input box for my "Submitted By"
  3. I deleted the coding calling out the "Submitted By"
  4. Then I deleted the column in sharepoint list 
  5. Saved and closed List and PowerApps
  6. Restarted List and PowerApps
  7. Remade the column as a text (orginally I tried just editing the column but it did not seem to take, even after a refresh)
  8. Refreshed Data Source in PowerApps
  9. Deleted \\from the code refernecing the collection
  10. Put input box for "Submitted By" with text wrap Text(User().email))
  11. Typed back in the all code calling out the "Submitted By"

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,258)