Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable count to recognize single elements values #655

Open
TobiasNx opened this issue Jan 30, 2025 · 0 comments
Open

Enable count to recognize single elements values #655

TobiasNx opened this issue Jan 30, 2025 · 0 comments
Labels

Comments

@TobiasNx
Copy link
Contributor

TobiasNx commented Jan 30, 2025

Currently if you have a singe element not an array, the count function does not do anything. It would be great if the function would then result in 1 instead.

Currently one has to do something like:

set_array("indexCountHelper[]")
do list(path:"array[]","var":"$i")
    copy_field("$i.a","indexCountHelper[].$append")
    copy_field("indexCountHelper[]","$i.indexPosition")
    if is_array("$i.indexPosition")
        count("$i.indexPosition")
    else
        add_field("$i.indexPosition","1")
    end
end

This is also related to the issue of #621.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

1 participant