Pass Variable and Value from One Card to Another Card Livecode - livecode

I have a livecode project with two cards in a mainstack.
One card "Card1" has a text field and a "submit" button.
The other card "Card2" has a label.
I want the user to enter a text into the text field of "Card1". When the "submit" button is clicked, it jumps to another card which is "Card2" with the label text showing the content of the text field of "Card1"
How to do that?

I think you should be able to do
put cd fld "textField" into cd fld "otherField" of card "Card2"
to do that. If that doesn't work, you can instead do
put cd fld "textField" into theFieldText
go to card "Card2"
put theFieldText into cd fld "OtherField"
or alternately, you could use a global variable that the "Submit" button puts the field into, and an openCard handler on Card2 reads again and puts in the field. You can also use lock screen and go back if you don't want to go to Card2 yet to get back to the first card.

Related

How to search a text using Enter key in blue prism

I have a search box where I can enter the search text however there is no search button next to it. So we use to press enter button after enter the search text in text box.
Please advise how to handle this in blue prism. I have tried using Global Send Keys however the focus moved out of the search box hence nothing happening
If the mouse focus is inside the text box then you can see a 'X' mark inside it
If I use the global sendkeys then the mouse focus is outside the text box as below
To go about this issue, I would first try to set the focus on the field, by sending a Global Mouse Click Center (not just focus) to the Textbox.
Next, send the "{ENTER}" or "~" key to the Textbox, using Send Global Keys.
I would assume that if that doesn't work, you have spied the container of the Textbox, not the Textbox itself somehow.
Alternatively, as a last resort you can also choose to send a Javascript command to the webpage, in order to trigger the form submission. This can be achieved by using the Navigate stage on the Application Model's top element (highest in hierarchy).
Good luck!

Powerapps: button selection on a previous screen prefill a field in a form

I am attempting to build an app with Microsoft powerapps that will be writing/reading data to/from an excel sheet.
I have created a form in powerapps from a table in the excel sheet. I am curious to know if anyone knows how to fill the data in a field based on a button selection on a previous screen.
As an example let's say the following fields are in the form; Location, Action, Item, Username.
This is what I am imaging and would like to do;
I would like the first two fields to be filled by selecting buttons on a previous screens instead of a drop down menu in the edit form view. the last two field can be filled by inputting text on a thirds screen.
The flow:
Screen1; presents two 4 locations in the form of buttons*doesn't necessarily have to be a button but function like one.
4 locations: NY, LA, AZ, LN
when users selects "NY" button, "NY" is filled/stored in to the "location" field in the form and the screen navigates to the next page where the user will select the actions.
Screen2; presents two 2 actions in the form of button.
2 Actions: remove, add
when users selects "remove" button, "remove" is filled/stored in to the "action" field in the form and the screen navigates to the next page where the user will fill the other two fields in a text field.
Screen3; has two text fields where user can fill in the rest of the information for item and user name. Location and Action should be prefilled at this point. When the user submits the form all data is submitted and a row is created in the excel table with all the information captured.
any information how to make a button selection on a previous screen prefill a field in a form that would be awesome! thank you for reading.
It sounds like you want to use a collection. A collection can be used similar to a global variable and will allow us to access data on a different screen than the one we set it on.
Some useful information can be found here:
https://powerapps.microsoft.com/en-us/tutorials/working-with-variables/#create-a-collection
https://powerapps.microsoft.com/en-us/tutorials/function-clear-collect-clearcollect/
Based off of your flow, let's assume that the screens are named as follows:
Screen1 will be "SpecifyLocation"
Screen2 will be "SpecifyAction"
Screen3 will be "FinalizeInput"
The names are arbitrary, but I think they'll make the following example easier to follow.
On the screen "SpecifyLocation", we're going to create four buttons. They will all be identical, except for the name of the location they reference. For instance, the button referencing "NY" would be as follows:
Text = "New York"
OnSelect = ClearCollect( LocationMetadata, "NY" ); Navigate(SpecifyAction,ScreenTransition.Cover)
Please note that the OnSelect value is two different functions separated by a semicolon. The first function, ClearCollect(), clears all information in a collection and then writes a new entry. In this case, we have a collection named LocationMetadata into which we are writing the value "NY". The second function, Navigate(), changes which screen we are looking at.
On the screen "SpecifyAction", we're going to create two buttons. They will be similar, except for the action they refer to. For instance, the button referencing "Add" would be as follows:
Text = "Add"
OnSelect = ClearCollect( ActionMetadata, "Add" ); Navigate(FinalizeInput,ScreenTransition.Cover)
As was the case before, we've created a button that calls two functions when clicked. They are the same two functions as last time; however, we've changed LocationMetadata to ActionMetadata in our ClearCollect() call, since we want to store a different piece of information. We've also changed our Navigate() call to move us over to the "FinalizeInput" screen.
I'm not entirely sure how you've got your final screen laid out, but in any case, you'll want to access the data we stored in collections previously. This can be done with the function First(), which returns the first element of a collection.
To access our selected location, you can use: First(LocationMetadata).Value
To access our selected action, you can use: First(ActionMetadata).Value
You should be able to supplement whatever extra data is collected from your user on this final screen with the collections we set up.

Hyperlinks on a picture or map

I would like to take a picture, in this case a map of houses, and insert links over each house that shows owner details. Also have a list of owners that when I click on their name takes me to their house on the picture.
Say that is your map of houses. Whatever software you are using; Word, PowerPoint, Publisher, etc; you can add textboxes. Make a textbox for each of the houses and place it above the each of the houses. Make these textboxes set to "In Front of Text" so that you can put them above the map. Make the size of the textboxes the same as that of the houses. Then right click the textbox and click "Hyperlink". You can then add a website address or a link to another document.
To add link for the names of people, highlight the text. Right click the highlighted text and click "Hyperlink". Again, you can add the website link if wanted.
If you want the name to go to the house, you will have to create "bookmarks". Right click the text boxes we created before for each house. Then go to Insert > Links group > Bookmark. This is the screen:
Then type a name for that bookmark without spaces (e.g. House_1). Then click "Add". After that, highlight the name of the person, right click, and then click "Hyperlink". Then go to "Place in this Document". There should be a bookmark called "House_1" (or whatever you named it). Click that and then click OK like this:
Now each time you click the name (in my example, "Jack"), the Word Document will automatically scroll to that house. You can do the same in PowerPoint as well. Any clarification, leave a comment.

TouchDevelop Deleting text

The Issue:
I have two buttons, button "Apple" and button "Cookie".
When I press the "Cookie" button, text should show saying "Cookie" on screen (which it does)
THEN, when I press the "Apple" button, the text should UPDATE to "Apple" instead of "Cookie"
The problem is, with my current code, whenever I press the second button (Apple) -- the original "Cookie" text isn't removed, it appears underneath the "Apple" text.
I'd like the "Cookie" text to be removed from the screen when I press the apple button or any other button (over 10 buttons)
How would I achieve this within touchdevelop?
Current Code:
Assistance is very much appreciated.
Try this project: http://tdev.ly/ydcl.
To change what is displayed when a button is clicked, set a global variable and change its value when on tapped is called. In TouchDevelop, the page display is refreshed automatically so that any changes made when a button is tapped will occur immediately. There is no need to hide or show part of the display; just include that section in an if statement and change the if statement condition when a button is tapped. If you wanted to show one of three possible layouts, use an if statement that tests the value of a string or number for one of three values and changes that value when a certain button is tapped or condition is met.

How do I drag and drop items within a LiveCode application?

I am building a LiveCode stack and want to add drag drop into my app. In particular, I would like to be able to click on one image and drag it to a second location.
I would also like to provide feedback to the user that they are in fact dragging. A thumbnail would be ideal.
I know how to change the cursor when I hover over my image:
on mouseEnter
lock cursor
set the cursor to "hand"
end mouseEnter
on mouseLeave
unlock cursor
end mouseLeave
Dragging within LiveCode is accomplished by the various drag messages that are available. An example of this if you have two images on your stack would be-
Script of image 1
on dragStart
set the dragData["text"] to the text of image 1
set the dragImage to the id of me
end dragStart
Script of Image 2
on dragEnter
set the dragaction to "copy"
end dragEnter
on dragDrop
set the text of the target to the dragData["text"]
end dragDrop
When image 1 is clicked and dragged, its text (contents) are placed into the dragData array, its dragAction is set to copy and the drag image is set to the image id of itself. THis is the transparent image that indicates what you are dragging.
In image 2, when a user is dragging and enters the image, it sets the acceptDrop to true and when the user releases the mouse (dragDrop) the text of the image is set the to the dragData["text"] array
While the drag and drop suite of commands and messages is rich and powerful, if all you need to do is move something from one location to another inside of your application window, don't overlook the simple grab command. It allows you to click down on an object and have the object follow your mouse pointer until you release the mouse button. For example, the following script in the object to be dragged works well.
on mouseDown
grab me
end mouseDown
on mouseUp
# do whatever evaluation you need to do here
# e.g., check to see whether the drop location is a valid target area
# Here is one way to do it:
if the location of the target is within the rect of graphic "hotspot" then
put "That's right!" into fld "feedback"
end if
# If you are dragging to an irregular target area do this instead:
if within(graphic "irregularPoly",the loc of the target) then
put "That's right!" into fld "feedback"
end if
end mouseUp

Resources