cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rehankazi
Advocate I
Advocate I

Whats the code to copy the hyperlink value on screen1 to Screen 2 in search text box?

rehankazi_0-1634823154877.png

I would like to know the code of copying/adding the select value on Screen 1 (hyperlink) to the search box on screen 2?

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

@rehankazi 

Just to add another suggestion onto @poweractivate's answer,which is completely fine, another way is to amend your call to navigate so that it passes the selected field value to ScreenStaffDetails.

Navigate(ScreenStaffDetials,
         ScreenTransition.Cover,
         {locSelected:DataTable1.Selected.AttendedBy}
)

This formula passes the selected value in a variable called locSelected. You should use the Intellisense in the editor to confirm that DataTable1.Selected.AttendedBy is valid.


You can then set the Default property of your textbox on ScreenStaffDetails to locSelected.

 

View solution in original post

10 REPLIES 10
poweractivate
Community Champion
Community Champion

@rehankazi 

 

On Default property of TextBox put this

"https://example.com"

To go further though

Your hyperlink appears to be inside a Table or Collection. Then you need to do 

First(SomeTable).SomeFieldWithHyperLinkInSideOfIt

Above is rough idea, you must check the detail for yourself.

 

See if it helps @rehankazi 

 

@poweractivate ,thanks 

 

But I don't understand, as I have to use navigate function as well, so my code should look like

 

Navigate(ScreenStaffDetials,ScreenTransition.Cover................ 

 

I am not sure what code should I put after NAVIGATE, as I want the value to be copied on the second screen text box which has the search function also for second screen as well.

 

@rehankazi 

Then you need variable.

on Screen1 where that Table is you need to put this either OnVisible of the Screen, 

Set(myVariable01,First(SomeTable).SomeFieldWithHyperLinkInSideOfIt)

or instead, just BEFORE the Navigate in your Formula property where you already put it:

Set(myVariable01,First(SomeTable).SomeFieldWithHyperLinkInSideOfIt);Navigate(ScreenStaffDetails....)

 

 On Screen 2 where the TextBox is in Default property put simply this now

myVariable01

 

Check if it helps @rehankazi 

rehankazi
Advocate I
Advocate I

I am still getting an error

 

rehankazi_0-1634829229216.png

 

@rehankazi 

 

For

 

First(DataTable1)

 

Instead of DataTable1 you should put there the original source of the DataTable1 such as the Table or Collection directly - see if it helps. You can try and check the DataTable1 Items property to find out what this was.

rehankazi
Advocate I
Advocate I

I got the code without error, but it does not work. It does not copy the value of my hyperlink on the screen 2 TextBox

timl
Super User
Super User

@rehankazi 

Just to add another suggestion onto @poweractivate's answer,which is completely fine, another way is to amend your call to navigate so that it passes the selected field value to ScreenStaffDetails.

Navigate(ScreenStaffDetials,
         ScreenTransition.Cover,
         {locSelected:DataTable1.Selected.AttendedBy}
)

This formula passes the selected value in a variable called locSelected. You should use the Intellisense in the editor to confirm that DataTable1.Selected.AttendedBy is valid.


You can then set the Default property of your textbox on ScreenStaffDetails to locSelected.

 

View solution in original post

poweractivate
Community Champion
Community Champion

@rehankazi I think the answer from @timl is better.

I also like the select of the DataTable which I didn't mention in mine:

 

 

DataTable1.Selected.AttendedBy

 

 

I think you should go ahead and consider to do it like that too @rehankazi 

Note that like @timl said the above is not intended to be exact, you need to check on DataTable1.Selected.AttendedBy - if it is not correct, you need to put whatever the correct one is for you. You can type YourDataTableName.Selected. and then see in the IntelliSense what shows up and start typing the name of that Column. 

 

 

 

Thank you so much @poweractivate you have been a great help.....have a great day!!

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 (1,085)