A user may want to send an invitation link created in the application to a friend. In this case, the link text can be copied to the clipboard via a button.
Adding a Copy Link Action for the User
Enter the
- UI Design module and drag and drop a Button element from the Elements panel on the left side.
- In the Properties panel, enter a phrase such as ‘Copy Link’ in the Label section of the button.
- Select the relevant button and add the + ADD ACTION menu: OnClick → Device → Copy to Clipboard action.
Configuring the Copy to Clipboard Action
- Value: The link to be copied to the clipboard.
- Example (static value): https://kuika.com/invite?user=123
- Example (dynamic value): inviteData.link
- If the link will be dynamically retrieved from a data source (e.g. a record from an API):
- The button should be located in a form or detail page linked to a data source.
- An object such as inviteData should contain the relevant record information.
- In this case, a binding can be made to the Value field as ‘inviteData.link’.
- This allows links specific to each user or each record to be copied to the clipboard.
With this configuration, when the user clicks the button, the specified link is copied to the clipboard and the user can share it by pasting it elsewhere.