SOLVED

A space appears in some of the records added via a for Powerapps

Brass Contributor

Hi,

I have a PowerApp that loads data into SharePoint, via a Form submission.  We have identified that some of the records for certain columns, contain a single space at the beginning?  

This seems to be having a knock on affect to the process of sending a mail out to them.  This is performed using a Flow.

Firstly Why would the happen randomly?
Secondly Is there a way to resolve this is SP or would it have to be resolved from the app?

6 Replies

@Chris_Clark1968 I would suggest you to correct this from Power app itself. So, you will not face any problem later while accessing this data from SharePoint.

 

Check what is the formula used for these columns while saving data. If these are free text input fields on power apps form & users are entering (or copy/pasting data from somewhere) spaces in these fields, you can trim the spaces while saving the data using functions in power apps:

 

You can use either of below functions as per your requirements:

  1. TrimEnds() - Removes all spaces from the start and end of a string of text but leaves spaces between words intact.
  2. Trim() - Removes all spaces from a string of text except for single spaces between words.

Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

@ganeshsanap 

I've found that another issue may have an impact on this.  I've raised another discussion but it seems that this is only happening when a group of people are being added.

Weird characters are appearing before two fields Staff Name and Email.
From the Powerapp these are Concat before being submitted to the SP site.  It seeems it started a few weeks ok.  The app has not been updated.

The characters displaying are ⁢br>

@Chris_Clark1968 Can you show us the formula you used for these fields while saving the data?

It will help us to identify the exact issue and provide you the precise solution.


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

@ganeshsanap 

Once the group (2 or more) are selected from the search screen they appear in the 'Groupform'

Chris_Clark1968_0-1658761374882.png

The Submit button becomes active once the required fields have been completed.

The submit button, 'On Select' is 

With(
{
'Staff Name': Split(
StaffName.Text,
","
),
JobTitle: Split(
JobTitle.Text,
","
),
Email: Split(
Email.Text,
","
),
'Ward Name': Split(
WardName.Text,
","
),
Divison: Split(
Division.Text,
","
)
},
ForAll(
Sequence(CountRows('Staff Name')),
Patch(
'Clinical Supervision',
Defaults('Clinical Supervision'),
{
'Staff Name': Last(
FirstN(
'Staff Name',
Value
)
).Result,
'Job Title': Last(
FirstN(
JobTitle,
Value
)
).Result,
Email: Last(
FirstN(
Email,
Value
)
).Result,
'Ward Name': Last(
FirstN(
'Ward Name',
Value
)
).Result,
Supervisor: Supervisor.Text,
'Supervision Subtype': SupervisionSubtype.Selected,
'Other Reason': OtherReason.Text,
'Supervision Type': SupervisionType.Text,
'Supervisor Email': SupervisorEmail.Text,
'Reflections Actions': ReflectionsActions.Text,
'Date Supervision': SupervisionDate.SelectedDate
}
)
)
);
Notify(
"Clinical Supervision Group Form",
NotificationType.Success,
5000
);
Navigate('Home Screen')


It only seems to happen periodically??

Update 28/07

Looking at the SP site recently, the 'weird' characters seemed to have changed to just <br> which seems to suggest this is an HTML issue but not sure how as no HTML is used in the formula???? 

 

best response confirmed by Chris_Clark1968 (Brass Contributor)
Solution

@Chris_Clark1968 Did you try using Trim functions while patching data in SharePoint from power apps?


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

@ganeshsanap ,

Would the trim() function be used against the whole patch formula or just the datacards where the character(s) are displaying?

Staff Name & Email

1 best response

Accepted Solutions
best response confirmed by Chris_Clark1968 (Brass Contributor)
Solution

@Chris_Clark1968 Did you try using Trim functions while patching data in SharePoint from power apps?


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

View solution in original post