cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ddas
Level: Powered On

Re: Use button to fill in data card text box with Office365Users.MyProfile().DisplayName info.

Thanks for being so detailed and putting so much info for me to follow. I renamed the datacard and Column in the sharepoint list to what you called it to make everything easier to follow. I have followed your directions but my button doesn't seem to do anything when it is clicked. Below is a screen shot of the OnVisible of the EditScreen 

formFormula.PNG

I think it is correct but you can tell me for sure.

For the button I added the formula you suggested. 

UpdateContext({_DigitalSig: Office365USers.MyProfile().DisplayName})

Not sure where I went wrong but your insight would be greatly appreciated. Thanks.

TimRohr
Level 10

Re: Use button to fill in data card text box with Office365Users.MyProfile().DisplayName info.

 

 

What does your DigitalSig datacard have for the Default property? (If you see "Parent.Default" then you're looking at the textbox input for the datacard. Pull up the Datacard.) It should point to _DigitalSig, instead of "ThisItem.DigitalSig."

 

ALTERNATE OPTION:

All of this said... if we can't get this context variable approach to work AND provided you have the proper field structure for the record (that is, one field for the "owner" of the form, and another for the signature-acknowledgment of that person authorizing the form), you could use a Patch() statement in your button. Leave the Datacard point to the "ThisItem.DigitalSig" field, but use Patch() to update the DigitalSig field in the Sharepoint list, setting it to be the DisplayName. That's another way to get where you want to go. The important thing is that you have the differentiation between the two fields (employee owner and signature).

 

ddas
Level: Powered On

Re: Use button to fill in data card text box with Office365Users.MyProfile().DisplayName info.

Below is a screen shot of the _DigitalSig datacard. _DigitalSig has ThisItem.DigitalSig on the Default Property.  DataCardValue51 has Parent.Default in the Default Propery. If I change ThisItem.DigitalSig to ThisItem._DigitalSig I get an error. 

DataCard.PNG

TimRohr
Level 10

Re: Use button to fill in data card text box with Office365Users.MyProfile().DisplayName info.

I think something got lost in transmission... if you are going to match my naming suggestions (or even just to make sense of my naming suggestions) this is what you would have to do:

 

SharePoint list field is named "DigitalSig"

DataCard on form is named "DigitalSig_EditScreen" (or something similar... something NOT "_DigitalSig")

Context variable is named "_DigitalSig"

 

Then put the code into the various parts of the app as I described (creating the context variable in the OnVisible event of the form, changing it in the button OnClick, etc.).

 

Finally, make the Default of the DataCardValue51 control to be "_DigitalSig"... if you do NOT have your datacard named this, there should be no confusion, and the app should read the context variable into the textbox.

 

 

Highlighted
ddas
Level: Powered On

Re: Use button to fill in data card text box with Office365Users.MyProfile().DisplayName info.

Hey @TimRohr

 

Thanks for all your help and patience!