Skip to content

Commit

Permalink
Updating help.md
Browse files Browse the repository at this point in the history
  • Loading branch information
rmurray-r7 committed Jan 14, 2025
1 parent 56ea67a commit b69d705
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 deletions.
4 changes: 2 additions & 2 deletions plugins/string/.CHECKSUM
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"spec": "c957502ef3eb0b416e91445e327d1d7a",
"spec": "f712d68ed3cdd1ab0abb816e1500f77d",
"manifest": "ff9feb5c62cc6078a3212085652011c3",
"setup": "394787d1ead943699cecc2712c114b1b",
"schemas": [
Expand All @@ -25,7 +25,7 @@
},
{
"identifier": "split_to_object/schema.py",
"hash": "41201592318a69a4d5e9cb62d214b600"
"hash": "67ae59d7cf96ba0f195ab4e26dfa6592"
},
{
"identifier": "trim/schema.py",
Expand Down
39 changes: 21 additions & 18 deletions plugins/string/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,21 @@ Example output:

#### Split String to Object

This action is used to convert a string to an object containing key:value strings
This action is used to convert a string to an object containing key:value strings.

Any input requiring more than a
single key:value pair, e.g. `USER=Bob` needs to use the `block_delimiter` option. In this case, the input string is
split by the `block_delimiter` character first, and the resulting items are then split by the `string_delimiter` option.
Stripping of double-quotes is automatically applied in this situation for each item before the plugin returns it.

The
[output object](https://docs.komand.com/v0.42.1/docs/python-script-plugins#section-configure-the-plugin-output-schema)
on the action's page can be modified to pre-populate the workflow with the names of the keys. It allows users the
ability to use the green selector and choose a specific variable later in the workflow by name. [Input
templating](https://docs.komand.com/docs/input-templating) would need to be used to obtain variables by name otherwise.


Please refer to troubleshooting section for a more complex example

##### Input

Expand Down Expand Up @@ -319,26 +333,15 @@ Example output:

## Troubleshooting

* There may be complex string manipulation needs that are likely outside the scope of this plugin. If this is the case, consider using the Python 3 Script plugin instead.
* For the `Split String to Object` action:,

Any input requiring more than a single key:value pair, e.g. `USER=Bob` needs to use the `block_delimiter` option.
In this case, the input string is split by the `block_delimiter` character first, and the resulting items are then split
by the `string_delimiter` option. Stripping of double-quotes is automatically applied in this situation for each item before the plugin returns it.

The [output schema](https://docs.komand.com/v0.42.1/docs/python-script-plugins#section-configure-the-plugin-output-schema) on the action's page can be modified to pre-populate the workflow with the names of the keys.
It allows users the ability to use the green selector and choose a specific variable later in the workflow by name.
[Input templating](https://docs.komand.com/docs/input-templating) would need to be used to obtain variables by name otherwise

* More complex string input that contains multiple key:value pairs. These pairs are separated from each other by a space, and the keys and values within each pair are separated by an equal sign:
* `Split String to Object`: if the input contains multiple key:value pairs and these pairs are separated from each other by a space, and the keys and values within each pair are separated by an equal sign we can follow the below example:

```Computer_ID="bef41e8b-47b8-e188-8e43-3a2b662dd55d" Computer_Name="dgdemo RGWin64" Computer_Type="Windows" ```
+ Example text: `Computer_ID="bef41e8b-47b8-e188-8e43-3a2b662dd55d" Computer_Name="dgdemo\RGWin64" Computer_Type="Windows"`
+ Example Input: `{"block_delimiter": " ","string":
"Computer_ID="bef41e8b-47b8-e188-8e43-3a2b662dd55d" Computer_Name="dgdemo RGWin64" Computer_Type="Windows","string_delimiter": "="}`
+ Example output: `{ "object": { "Computer_ID": "bef41e8b-47b8-e188-8e43-3a2b662dd55d", "Computer_Name": "dgdemo RGWin64", "Computer_Type": "Windows" } }`

Setting `block_delimiter` to ` ` and `string_delimiter` to `=` will return the information presented in the example below.

Example output:

``` { "object": { "Computer_ID": "bef41e8b-47b8-e188-8e43-3a2b662dd55d", "Computer_Name": "dgdemo RGWin64", "Computer_Type": "Windows" } } ```
* There may be complex string manipulation needs that are likely outside the scope of this plugin. If this is the case, consider using the Python 3 Script plugin instead.

# Version History

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


class Component:
DESCRIPTION = "This action is used to convert a string to an object containing key:value strings"
DESCRIPTION = "This action is used to convert a string to an object containing key:value strings.Any input requiring more than a single key:value pair, e.g. `USER=Bob` needs to use the `block_delimiter` option. In this case, the input string is split by the `block_delimiter` character first, and the resulting items are then split by the `string_delimiter` option. Stripping of double-quotes is automatically applied in this situation for each item before the plugin returns it.The [output object](https://docs.komand.com/v0.42.1/docs/python-script-plugins#section-configure-the-plugin-output-schema) on the action's page can be modified to pre-populate the workflow with the names of the keys. It allows users the ability to use the green selector and choose a specific variable later in the workflow by name. [Input templating](https://docs.komand.com/docs/input-templating) would need to be used to obtain variables by name otherwise.Please refer to troubleshooting section for a more complex example"


class Input:
Expand Down
5 changes: 2 additions & 3 deletions plugins/string/plugin.spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ version_history:
- "1.0.1 - Update plugin tag from `util` to `utilities` for Marketplace searchability"
- "1.0.0 - Initial plugin"
troubleshooting:
- "`Split String to Object`: if the input contains multiple key:value pairs and these pairs are separated from each other by a space, and the keys and values within each pair are separated by an equal sign we can follow the below example:\n\n + Example text: `Computer_ID=\"bef41e8b-47b8-e188-8e43-3a2b662dd55d\" Computer_Name=\"dgdemo\\RGWin64\" Computer_Type=\"Windows\"`\n + Example Input: `{\"block_delimiter\": \" \",\"string\":\n\"Computer_ID=\"bef41e8b-47b8-e188-8e43-3a2b662dd55d\" Computer_Name=\"dgdemo RGWin64\" Computer_Type=\"Windows\",\"string_delimiter\": \"=\"}`\n + Example output: `{ \"object\": { \"Computer_ID\": \"bef41e8b-47b8-e188-8e43-3a2b662dd55d\", \"Computer_Name\": \"dgdemo RGWin64\", \"Computer_Type\": \"Windows\" } }`\n\n"
- "There may be complex string manipulation needs that are likely outside the scope of this plugin. If this is the case, consider using the Python 3 Script plugin instead."
- "For the `Split String to Object` action:, \n\nAny input requiring more than a single key:value pair, e.g. `USER=Bob` needs to use the `block_delimiter` option.\nIn this case, the input string is split by the `block_delimiter` character first, and the resulting items are then split\nby the `string_delimiter` option. Stripping of double-quotes is automatically applied in this situation for each item before the plugin returns it.\n\nThe [output schema](https://docs.komand.com/v0.42.1/docs/python-script-plugins#section-configure-the-plugin-output-schema) on the action's page can be modified to pre-populate the workflow with the names of the keys.\nIt allows users the ability to use the green selector and choose a specific variable later in the workflow by name.\n[Input templating](https://docs.komand.com/docs/input-templating) would need to be used to obtain variables by name otherwise\n"
- "More complex string input that contains multiple key:value pairs. These pairs are separated from each other by a space, and the keys and values within each pair are separated by an equal sign:\n\n ```Computer_ID=\"bef41e8b-47b8-e188-8e43-3a2b662dd55d\" Computer_Name=\"dgdemo\ RGWin64\" Computer_Type=\"Windows\" ``` \n\n Setting `block_delimiter` to ` ` and `string_delimiter` to `=` will return the information presented in the example below.\n\n Example output: \n\n ``` { \"object\": { \"Computer_ID\": \"bef41e8b-47b8-e188-8e43-3a2b662dd55d\", \"Computer_Name\": \"dgdemo\ RGWin64\", \"Computer_Type\": \"Windows\" } } ```"
links:
- "[Python 3 String Methods](https://docs.python.org/3/library/stdtypes.html#string-methods)"
references:
Expand Down Expand Up @@ -112,7 +111,7 @@ actions:
example: '["This", "is", "a", "sentence"]'
split_to_object:
title: Split String to Object
description: "This action is used to convert a string to an object containing key:value strings"
description: "This action is used to convert a string to an object containing key:value strings.\n\nAny input requiring more than a single key:value pair, e.g. `USER=Bob` needs to use the `block_delimiter` option. In this case, the input string is split by the `block_delimiter` character first, and the resulting items are then split by the `string_delimiter` option. Stripping of double-quotes is automatically applied in this situation for each item before the plugin returns it.\n\nThe [output object](https://docs.komand.com/v0.42.1/docs/python-script-plugins#section-configure-the-plugin-output-schema) on the action's page can be modified to pre-populate the workflow with the names of the keys. It allows users the ability to use the green selector and choose a specific variable later in the workflow by name. [Input templating](https://docs.komand.com/docs/input-templating) would need to be used to obtain variables by name otherwise.\n\nPlease refer to troubleshooting section for a more complex example"
input:
string:
title: String Input
Expand Down

0 comments on commit b69d705

Please sign in to comment.