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

Patching Two Fields in single column

Hi guys,

I need to patch two text fields in a single column but how can i achieve that?

May be concatenate? 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @rahulmathur7 ,

Could you tell me does Appointments entity have required field? The formula that you listed only patch with lookup field. You need to update with required field.

What's more, since you need to add the judgment of Contacts entity, so you could only use Patch function to update Appointments entity instead of SubmitForm function.

I assume that you want to use form3 to create new record in Appointments entity.

Try this formula:

If(IsEmpty(Filter(Contacts,
                  firstname=TextInput1.Text,lastname=TextInput1_1.Text,jobtitle=TextInput1_2.Text
                  )
           ),
   Patch(Contacts,Defaults(Contacts), 
         {firstname:TextInput1.Text,lastname:TextInput1_1.Text,jobtitle:TextInput1_2.Text}
         )
   );
Patch(Appointments,Defaults(Appointments),
      {field1:...,field2:....,
       requiredattendees:
                         LookUp(Contacts,firstname=TextInput1.Text&&
                                         lastname=TextInput1_1.Text&&
                                         jobtitle=TextInput1_2.Text
                                )
        }
       )

 

 

 

Best regards,

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

10 REPLIES 10
Super User III
Super User III

@rahulmathur7 

You can join the contents of two labels using the ( & ) symbol.

 

Patch(
    your_datasource_name,
    LookUp(your_datasource_name, ID = some_id_number),
    {
        YourField1: TextInputA.Text & TextInputB.Text //this line joins two strings
    }
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Anonymous
Not applicable

@rahulmathur7 

Just using patch(source, record, concatenate(Text1, Text2) should work?

@Anonymous Where will i get record parameter from.Its when adding a new record where the problem is.

Anonymous
Not applicable

@rahulmathur7 

What data are you patching?

Whats the reason for you patching it?

Is there data that coincides with it?

Are there other fields in that data?

Or are you only trying to patch those 2 fields in as new data?

@Anonymous So we have an option in our form in which if a contact is not present in our masters user can add a new contact by typing in contact's first and last name.Now those 2 text boxes get saved in our contact master entity.We also want it to be stored in another entity in "Contact's Name " Column.So we are thinking of patching it to that column.

NOTE : The field is a lookup field in out form so when a user click "New" check box the two text boxes appear.

Anonymous
Not applicable

@rahulmathur7 

So let me confirm -

If the user does not exist as a masters user, they can be added using their first and last name.

Side note - Why are they being added using first name and last name instead of an office lookup? Since you said they could be a masters user does that not mean they are registered on the company office 365 list?

Are you not using a form to submit new users?

If you are why not use another field in it that concatenates the first and last name?

Or use a calculated column that autofills itself out with the concatenated version of the fields?

If it's being stored in another entity, is that like an assigned user entity?

If you know what the other entity it then just use the id from that entity or filter to find the correct one inside a patch 🤔

@Anonymous 
Yes if a contact is not in the "Contact" entity the user can add a client using first and last name.
Since contact is a client's employee he/she is not part of office 365 in our domain.
Please find the attached picture.So the fields marked in red are the fields added manually they are not part of the form.
Rest of the fields are part of the form.So we just need when the first and last name are filled it should enter data both in the "Contact" entity creating a master and in the "Appointment" entity under "Who you met with " column.
Below is the code applied on save button.

 

 

 

If(varCheck=true,Patch(Contacts,Defaults(Contacts),{firstname:TextInput1.Text,lastname:TextInput1_1.Text,jobtitle:TextInput1_2.Text}));SubmitForm(Form3);Notify("Successfully submitted");ResetForm(Form3); 

 

 

 

Below is the code that is giving me error "Invalid Arguments in patch" when im trying to patch in appointments.

 

 

If(varCheck=true,Patch(Contacts,Defaults(Contacts),{firstname:TextInput1.Text,lastname:TextInput1_1.Text,jobtitle:TextInput1_2.Text});

Patch(Appointments,Defaults(Appointments),{requiredattendees:TextInput1.Text && TextInput1_1.Text}));SubmitForm(Form3);Notify("Successfully submitted");ResetForm(Form3); 

 

New Contact.png

NOTE:The column I am trying to patch is a lookup field.

Hi @rahulmathur7 ,

Do you mean that  the field is lookup field in contact master entity and you want to save the field's data in another entity in "Contact's Name " Column?

Could you tell me

1)use what controls to fill in the lookup field in contact master entity? two textinputs?

2)the data type of Contact's Name?

If you use two textinputs to fill in the lookup field in contact master entity and the data type of Contact's Name is text, please try this formula:

Patch(another entityname,Defaults(another entityname),{Contact's Name:Concatenate(TextInput1.Text, Textinput2.Text));
SubmitForm(Form1)

 

 

 

Best regards,

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1.Yes we want two text inputs to fill that look up column.
2.The contact's name in the master is a lookup type.


Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (51,053)