Month: July 2024
Enhancing Copilot Studio Extensions for SAP by using Adaptive Cards and Principal Propagation
In the previous blog, SAP connectivity from the Copilot Studio and Power Platform were explored, let’s now look at an enhanced version of the scenario explained in the previous blog in the newer video below:
Scenario description:
Let’s say, the salesperson realizes that material in the sales order placed by the customer is not available and wants to help replace the unavailable item for the customer in the sales order.
The salesperson does the following:
The salesperson asks the Copilot to help her look through all the materials in the SAP system to find the best replacement.
The salesperson gets a suitable replacement suggestion from Copilot and tries to access material stock information for that material. However, the salesperson is not authorized to do so as she does not have the right authorization to do so in the SAP system.
The salesperson messages her colleague who does have the authorization to check material stock information for her. The colleague checks the stock information and informs the salesperson that the material is in stock.
The salesperson now decides to update the sales order with the new material and remove the old material from the sales order.
As you can see from the video, the scenario has been enhanced and has additional two Power Platform and Copilot Studio abilities added to it:
Adaptive cards
Authorization/ Principal Propagation
Below is a description what they are and how to begin to implement them.
Adaptive cards:
Information returned via chatbots shouldn’t be restricted to looking only as good as the UI of the platform you deploy the bot on, it would be more interactive and personal to your brand to have a way to choose how users get to interact with the bot you created. This is where adaptive cards are a game changer.
Adaptive cards in Copilot Studio allow you to add interactive snippets of content, such as text, graphics, and buttons, to enhance conversation experiences with Copilots. You can read more about them here.
Here are some examples in the above scenario where adaptive cards were used:
1) To display the adaptive card with information from the SAP system in a digestible and visually appealing format with the SAP logo to show the information is from the SAP system
2)To create a form like input while modifying the sales order to provide an easy way to get information from the user with the SAP logo to show the change will be made to the SAP system.
To create and modify adaptive cards in the Copilot Studio, you can add an adaptive card either to a question or the message as shown below.
You can then modify the code in JSON ( as shown below) to make it look the way you want, add URLs for images/logos you would like to show. You can also use the adaptive card designer to have a better idea of the elements you can make use of.
The code for the adaptive cards used in the scenario are on the GitHub Repo.
Principal Propagation for Authorization:
Principal propagation ensures that a user’s identity is securely passed from one system to another, allowing for proper authorization and access control. It plays a crucial role in maintaining security and seamless user experiences across different systems.
In this case, it ensures that an M365 user has the right access to the SAP system to access information without them having to use their SAP credentials to login. Here is an outline of the steps to implement this:
Set Up Microsoft Entra ID: Entra ID serves as the central identity provider for your applications. It manages user identities, authentication, and access control. When a user logs in, AAD validates their credentials and issues tokens (such as JWT) that represent their identity.
Configure Azure API Management (APIM): APIM acts as a gateway for APIs, managing their exposure, security, and policies. It handles requests from clients and routes them to the appropriate backend services. In APIM, you configure AAD authentication for your APIs. When a client makes a request, APIM validates the token with AAD to ensure the user’s identity. Additionally, APIM forwards requests to the backend system (e.g., SAP) based on the API configuration, including features like caching and rate limiting.
Flow of Principal Propagation:
User requests an APIM endpoint.
APIM validates the user’s token with AAD.
If valid, APIM extracts the user’s identity.
APIM forwards the request to SAP with the user’s identity.
SAP uses this identity for authorization. SAP accepts only tokens they issued themselves and therefore we need to interact with their Identity Provider.
Integrating with Power Platform: You can create a custom connector in Power Platform that calls the APIM API. This allows you to seamlessly incorporate principal propagation into your Power Automate flow. You can read more about creating custom connector here.
Here are resources that discuss Principal Propagation and the steps associated with its implementation in detail:
Configure SAP Principal Propagation with AAD and SAP OAuth server
To learn more about how to implement this new version of the scenario visit the GitHub repo that has detailed instructions as well as Power Automate flows you can readily import to your environment.
Microsoft Tech Community – Latest Blogs –Read More
(Preview) How Office is improving the reliability of DLP policy tips on Windows
If you are an administrator who uses SharePoint and OneDrive DLP rules to protect your organization’s sensitive files, you may have noticed that the policy tips informing users about the policies applied to their files are not always reliable in Word, Excel, and PowerPoint on Windows.
We’ve heard your feedback and are happy to announce that we’re rolling out a new update to Office apps on Windows that will significantly improve the reliability of DLP policy tips for files stored in SharePoint and OneDrive for Business. This update will change how Office determines whether a policy tip should be shown for a file. Instead of trying to evaluate the policy rules on its own, Office will now show the same policy tip that is shown in SharePoint and OneDrive for Business. This will ensure that SharePoint or OneDrive for Business is always the source of truth, and Office will stay in sync on whether policy tips should be shown.
This update also eliminates the need for Office to download and cache policy XML files that contain potentially sensitivity information.
What you need to know
Here are some important details about how the new update will work and what you can expect:
The update will apply to files that live in ODSP (either opened from the host or from a sync-backed folder), and that are opened with a work account (an AAD identity) that is properly licensed for ODSP DLP.
The update will only work online, with no caching. If the user is offline, no policy tip UX will be shown. If the user goes offline after they were online and a policy tip was shown, the policy tip will remain visible.
The update will not affect the existing options to override a policy tip, report a false positive, or turn off policy tip UX. These features will continue to work as before.
How to get this update
This updated feature is currently rolling out in Current Channel Preview. We hope that it enhances your experience with ODSP DLP policy tips by making them more consistent and accurate. We appreciate your feedback and look forward to delivering more improvements in the future!
Microsoft Tech Community – Latest Blogs –Read More
How do I activate MATLAB or other MathWorks products without an internet connection?
How do I activate MATLAB and/or other MathWorks products on a computer that is not connected to the internet?How do I activate MATLAB and/or other MathWorks products on a computer that is not connected to the internet? How do I activate MATLAB and/or other MathWorks products on a computer that is not connected to the internet? MATLAB Answers — New Questions
Adding a Column to a Table
Hello everyone, I’ve just started out with Matlab for uni and am trying to add a column to a table. I ran into the following error message
Error using .
To assign to or create a variable in a table, the number of rows must match the height of the table.
My code is written below:
%Creates a table called ‘tab’ using the data in the coronavirus-cases.csv
%file.
tab = readtable("coronavirus-cases.csv");
%Creates a row of zeros with the same height as tab.
newTabCol = zeros(height(tab), 1);
%Adds the column and titles it "Seven Day Average".
tab.newTabCol = "Seven Day Average";
What confuses me is that the height of newTabCol matches tab. Both have 153772 rows:
I’m sure I’m missing something basic but any help would be appreciated.
Kind regards,
JohnHello everyone, I’ve just started out with Matlab for uni and am trying to add a column to a table. I ran into the following error message
Error using .
To assign to or create a variable in a table, the number of rows must match the height of the table.
My code is written below:
%Creates a table called ‘tab’ using the data in the coronavirus-cases.csv
%file.
tab = readtable("coronavirus-cases.csv");
%Creates a row of zeros with the same height as tab.
newTabCol = zeros(height(tab), 1);
%Adds the column and titles it "Seven Day Average".
tab.newTabCol = "Seven Day Average";
What confuses me is that the height of newTabCol matches tab. Both have 153772 rows:
I’m sure I’m missing something basic but any help would be appreciated.
Kind regards,
John Hello everyone, I’ve just started out with Matlab for uni and am trying to add a column to a table. I ran into the following error message
Error using .
To assign to or create a variable in a table, the number of rows must match the height of the table.
My code is written below:
%Creates a table called ‘tab’ using the data in the coronavirus-cases.csv
%file.
tab = readtable("coronavirus-cases.csv");
%Creates a row of zeros with the same height as tab.
newTabCol = zeros(height(tab), 1);
%Adds the column and titles it "Seven Day Average".
tab.newTabCol = "Seven Day Average";
What confuses me is that the height of newTabCol matches tab. Both have 153772 rows:
I’m sure I’m missing something basic but any help would be appreciated.
Kind regards,
John table, column, add, add column, height, zeros MATLAB Answers — New Questions
WAC Certificate Issue – PKI Signed Cert cannot be used
WAC Certificate Issue
when i change in appsettings.json the line
“Subject”: “WindowsAdminCenterSelfSigned”
to
“Subject”: “CN=admincenter.domain.int”
and change the netsh config:
netsh http delete sslcert ipport=0.0.0.0:443
netsh http add sslcert ipport=0.0.0.0:443 certhash=81893C1D789EA40EC8FC04FD08DB72DD44F2FBB1 appid=”{afebb9ad-9b97-4a91-9ab5-daf4d59122f6}”
restart-service WindowsAdminCenter
the WAC is not Accessible, because the WAC Service Cannot be started!
Why you did not use the Thumbprint in the appsettings.json file? because same Subject like servername.domain.int can be used multiple Times in a cert.
On the Other hand Thumbprint is fixed size length, Subject can be very long … like
“E=email address removed for privacy reasons, CN=admincenter.domain.internal, OU=Domain, O=company, L=munich, C=DE”
WAC Certificate Issuewhen i change in appsettings.json the line “Subject”: “WindowsAdminCenterSelfSigned” to “Subject”: “CN=admincenter.domain.int” and change the netsh config:netsh http delete sslcert ipport=0.0.0.0:443netsh http add sslcert ipport=0.0.0.0:443 certhash=81893C1D789EA40EC8FC04FD08DB72DD44F2FBB1 appid=”{afebb9ad-9b97-4a91-9ab5-daf4d59122f6}”restart-service WindowsAdminCenterthe WAC is not Accessible, because the WAC Service Cannot be started!Why you did not use the Thumbprint in the appsettings.json file? because same Subject like servername.domain.int can be used multiple Times in a cert.On the Other hand Thumbprint is fixed size length, Subject can be very long … like”E=email address removed for privacy reasons, CN=admincenter.domain.internal, OU=Domain, O=company, L=munich, C=DE” Read More
Outlook Web apps not showing up
I am on the outlook website and the apps are not showing up when I go to the add apps page.
My add-ins have also disapeared that I have been using for months. I have tried reinstalling but nothing happens.
It seems to be on just this account.
I am on the outlook website and the apps are not showing up when I go to the add apps page.My add-ins have also disapeared that I have been using for months. I have tried reinstalling but nothing happens. It seems to be on just this account. Read More
Removing the MS Sign-On from Startup: A Step-by-Step Guide
I am currently the sole user of this computer, and I accidentally entered an email address which now prompts me for a password every time the system starts up. How can I disable this login requirement so that I only need to press Enter or the space bar to access my computer?
Thank you for your assistance in resolving this issue.
I am currently the sole user of this computer, and I accidentally entered an email address which now prompts me for a password every time the system starts up. How can I disable this login requirement so that I only need to press Enter or the space bar to access my computer? Thank you for your assistance in resolving this issue. Read More
Followup sheet – Macro
Hello everyone,
After days of failing, I have come here to ask for your help gurus please!!
I am working on a VBA project in Excel that involves three main tabs:
Mailing: This tab contains a table with client names and emails. I have a button that allows sending emails to all clients listed in the table. This part is working perfectly!!!.
Followup: In this tab, I want to retrieve the 100 most recent emails from my inbox and fill them into a table. The goal is to read these emails and compare them with the emails sent from the “Mailing” tab to check if I have received responses from my clients.
Inbox: This tab serves as a database where the 100 most recent emails are stored. This is working as well!!
What I need:
WORKING – Retrieve the 100 most recent emails: I need help writing a VBA code that retrieves the 100 most recent emails from my Outlook inbox and fills the “Inbox Emails” tab.NOT WORKING – Compare and update status: After filling the “Inbox Emails” tab, I need the VBA to read each of the 100 emails and compare them with the emails sent listed in the “Mailing” tab. If there is a response from a client, the status should be updated to “New Answer”. If there is no response, the status should be “Waiting”.
I appreciate any help in advance and am available to clarify any questions. Please reach to me in any platform!
Hello everyone,After days of failing, I have come here to ask for your help gurus please!! I am working on a VBA project in Excel that involves three main tabs:Mailing: This tab contains a table with client names and emails. I have a button that allows sending emails to all clients listed in the table. This part is working perfectly!!!.Followup: In this tab, I want to retrieve the 100 most recent emails from my inbox and fill them into a table. The goal is to read these emails and compare them with the emails sent from the “Mailing” tab to check if I have received responses from my clients.Inbox: This tab serves as a database where the 100 most recent emails are stored. This is working as well!!What I need:WORKING – Retrieve the 100 most recent emails: I need help writing a VBA code that retrieves the 100 most recent emails from my Outlook inbox and fills the “Inbox Emails” tab.NOT WORKING – Compare and update status: After filling the “Inbox Emails” tab, I need the VBA to read each of the 100 emails and compare them with the emails sent listed in the “Mailing” tab. If there is a response from a client, the status should be updated to “New Answer”. If there is no response, the status should be “Waiting”.I appreciate any help in advance and am available to clarify any questions. Please reach to me in any platform! Read More
Adding a clarification question in Forms if a minimum score is returned
Hi we are in the process of moving some of our documents into forms. In one of them users are asked to score their abilities for a task between 1 and 10.
I would like to be able to ask a clarification if a responder answers 8, 9 or 10 to each response .
Is this possible? I cannot see in Branching how to determine what answer is given in order to a follow up question is required.
Hi we are in the process of moving some of our documents into forms. In one of them users are asked to score their abilities for a task between 1 and 10. I would like to be able to ask a clarification if a responder answers 8, 9 or 10 to each response . Is this possible? I cannot see in Branching how to determine what answer is given in order to a follow up question is required. Read More
MDE API to trigger custom detection rule run
Hi All,
We are deploying MDE custom detections to a new site via pipeline and some scripts using the API.
But since we are deploying and enabling the rules in groups, their last/next run are all the same in the group (especially for the ones with 12hrs/24hrs periods)
For now, only way I could find for changing the running start time is running the rule manually.
Is there a better way/API endpoint to run/change the periodic run time of the rules? If yes, with a script I can better disperse the rule periodic run times throughout the day.
Thanks in advance
Emin
Hi All, We are deploying MDE custom detections to a new site via pipeline and some scripts using the API. But since we are deploying and enabling the rules in groups, their last/next run are all the same in the group (especially for the ones with 12hrs/24hrs periods)For now, only way I could find for changing the running start time is running the rule manually. Is there a better way/API endpoint to run/change the periodic run time of the rules? If yes, with a script I can better disperse the rule periodic run times throughout the day. Thanks in advanceEmin Read More
Polls disappear when admitting external users to meeting
We are having trouble lately with polls within Teams webinars. As soon as the first external participant joins, the polls disappear. We put on many training webinars a month and rely on polling for interaction. Has anyone found a fix for this? Is it a known issue?
I found the below thread but it has more questions than answers:
We are having trouble lately with polls within Teams webinars. As soon as the first external participant joins, the polls disappear. We put on many training webinars a month and rely on polling for interaction. Has anyone found a fix for this? Is it a known issue?I found the below thread but it has more questions than answers:https://answers.microsoft.com/en-us/msteams/forum/all/teams-poll-option-getting-disappeared-during-the/d642ce2f-f772-4f41-8d69-f0835d2dd0d5https://answers.microsoft.com/en-us/msteams/forum/all/polls-disappearing-in-teams-live-webinar-as-soon/fea4f5c5-42ef-4fc2-9d96-0c3b1774b96a Read More
Fixing a Windows Boot Problem on a PC
Recently, my Samsung Galaxy Pro 360 underwent a significant software update. Following this update, my PC experienced a problematic boot sequence. Upon restarting, Windows would only partially load, displaying a limited taskbar and failing to proceed further. Despite the mouse functionality, the system would ultimately freeze, requiring a forced shutdown. This frustrating cycle persisted, with intermittent instances of Windows failing to load entirely and displaying the dreaded blue screen error message.
Before this update, my PC operated without any complications. To address the boot problem, I ran troubleshooting commands such as DISM and SFC /scannow, but to no avail. Seeking assistance from Samsung Support, I inquired about re-flashing the BIOS, only to be informed that it was not possible. This contrasted with my past experiences with Asus products, where I had successfully performed BIOS flashings independently. The support team’s proposed solution was to either reinstall Windows or consider purchasing a new laptop at a discounted rate.
In response to this conundrum, I have opted to acquire a new drive and will attempt to resolve the boot issue by implementing this hardware change. The underlying cause of this perplexing boot problem remains elusive, prompting further investigation into potential factors contributing to this ordeal.
Recently, my Samsung Galaxy Pro 360 underwent a significant software update. Following this update, my PC experienced a problematic boot sequence. Upon restarting, Windows would only partially load, displaying a limited taskbar and failing to proceed further. Despite the mouse functionality, the system would ultimately freeze, requiring a forced shutdown. This frustrating cycle persisted, with intermittent instances of Windows failing to load entirely and displaying the dreaded blue screen error message. Before this update, my PC operated without any complications. To address the boot problem, I ran troubleshooting commands such as DISM and SFC /scannow, but to no avail. Seeking assistance from Samsung Support, I inquired about re-flashing the BIOS, only to be informed that it was not possible. This contrasted with my past experiences with Asus products, where I had successfully performed BIOS flashings independently. The support team’s proposed solution was to either reinstall Windows or consider purchasing a new laptop at a discounted rate. In response to this conundrum, I have opted to acquire a new drive and will attempt to resolve the boot issue by implementing this hardware change. The underlying cause of this perplexing boot problem remains elusive, prompting further investigation into potential factors contributing to this ordeal. Read More
Troubleshooting: My Brand New Computer Won’t Start Up
I recently acquired a new computer without an operating system. Although I have two functional drives that successfully boot on my current Windows 10 and Windows 11 system, when I installed each drive separately in the new computer, they both failed to boot properly. The Windows loading screen appears, but then the process stalls.
I attempted creating a bootable USB using Windows, and also tried using an ISO file, but neither method worked. The BIOS recognizes all the drives and the USB drive.
Before attempting another boot, I also installed a graphics card. Would removing the graphics card make a difference in booting up successfully? Any assistance on this matter would be greatly appreciated. Thank you.
I recently acquired a new computer without an operating system. Although I have two functional drives that successfully boot on my current Windows 10 and Windows 11 system, when I installed each drive separately in the new computer, they both failed to boot properly. The Windows loading screen appears, but then the process stalls. I attempted creating a bootable USB using Windows, and also tried using an ISO file, but neither method worked. The BIOS recognizes all the drives and the USB drive. Before attempting another boot, I also installed a graphics card. Would removing the graphics card make a difference in booting up successfully? Any assistance on this matter would be greatly appreciated. Thank you. Read More
Video upload issue on teams chat
Teams has video upload bug on few last releases, please fix it
Unable to upload recording
Teams has video upload bug on few last releases, please fix itUnable to upload recording Read More
Ready, Set, AI: What our People Science research tells us about AI Readiness
On July 18, the Viva People Science team held the fourth webinar in its AI Empowerment series. During this webinar, I was joined by Carolyn Kalafut (Principal People Scientist at Microsoft Viva), Megan Benzing (Viva People Science Researcher) and Craig Ramsay (Viva People Science Researcher) who have been leading a research study into what it means to be ready for AI transformation as an organization.
We talked about the key insights that emerged from the research including:
AI and the employee experience being complementary to one another, and how a positive employee experience can help to drive successful AI transformation
How leaders and individual contributors are experiencing change differently, and the blind spots that leaders need to be aware of when planning an AI rollout strategy
How High Performing Organizations are taking a much more people-centric approach to change compared to typical organizations
The need to balance the excitement and hopes that employees have about AI with their concerns around data security, over-reliance on AI and job loss
The presenters wrapped up the session with some key principles for AI transformation based on their learnings from the research study. These included recognizing the scope of AI transformation and its impact, taking an agile approach and encouraging experimentation in teams, and taking a human approach to the change by leading with empathy and addressing concerns.
We invite you to watch the recording from this session, and those from our previous events in this series below. Discover more, engage with the content, and let’s embark on this journey together.
AI Empowerment: Introducing our Viva People-Science series for HR
AI Empowerment: Preparing your organization for AI with learnings from Microsoft
Microsoft Tech Community – Latest Blogs –Read More
Mensaje constante de actualización Matlab Connector
Hola a todos. Estoy usando la versión R2024a de Matlab y cada 5 o 10 minutos me aparece el mensaje "You already have the most recent version of MATLAB Connector installed". Entiendo que esta buscando actualizaciones, pero no se porque lo hace constantemente. Estoy en Windows 11.
Muchas gracias por su ayudaHola a todos. Estoy usando la versión R2024a de Matlab y cada 5 o 10 minutos me aparece el mensaje "You already have the most recent version of MATLAB Connector installed". Entiendo que esta buscando actualizaciones, pero no se porque lo hace constantemente. Estoy en Windows 11.
Muchas gracias por su ayuda Hola a todos. Estoy usando la versión R2024a de Matlab y cada 5 o 10 minutos me aparece el mensaje "You already have the most recent version of MATLAB Connector installed". Entiendo que esta buscando actualizaciones, pero no se porque lo hace constantemente. Estoy en Windows 11.
Muchas gracias por su ayuda matlab connector MATLAB Answers — New Questions
Importing files in bulk chnages table columns to NaNs
I have the following code in which I want to replace the column 37 in a table. I want to swap the column of categorical values for a column of numerical values.
% Open file selection dialog and allow multiple selections
[file_list, path_n] = uigetfile(‘*.csv’, ‘Select CSV Files’, ‘Multiselect’, ‘on’);
% Check if any files were selected
if ischar(file_list)
% Convert single file string to cell array
file_list = {file_list};
end
% Initialize a cell array to store the modified tables
modifiedTables = cell(length(file_list), 1);
% Loop through each selected file
for k = 1:length(file_list)
% Construct the full file path
filePath = fullfile(path_n, file_list{k});
% Import the CSV file as a table
T = readtable(filePath);
% Check if the table has at least 37 columns
if width(T) >= 37
% Extract the ‘OrderNumber’ column (column 37) and convert it to a string array
orderNumberColumn = string(T{:, 37});
% Initialize the new column as a double array with the same size as the original column
newOrderNumberColumn = zeros(size(orderNumberColumn));
% Convert the string values to doubles
for i = 1:length(orderNumberColumn)
numValue = str2double(orderNumberColumn(i));
if isnan(numValue)
% If conversion fails (non-numeric value), set the value to 0
newOrderNumberColumn(i) = 0;
else
% Otherwise, use the numeric value
newOrderNumberColumn(i) = numValue;
end
end
% Update only the 37th column with the new double column
T.(T.Properties.VariableNames{37}) = newOrderNumberColumn;
end
% Store the modified table in the cell array
modifiedTables{k} = T;
end
% Display the number of tables processed
disp([‘Number of tables processed: ‘, num2str(length(modifiedTables))]);
Unfortunately, the other columns (for example column 35, 36,38 and 39) also become affected when importing the csv files in bulk and hence my new modified table now contains NaNs even though I would like to only modify the column 37 (see "modifiedtables").
When I import via the user interface (see "imported_by_hand") or when I use the code below(see "T") that doesnt seem to happen.
T_copy = T;
% Extract the ‘OrderNumber’ column (column 37) and convert it to a string array
orderNumberColumn = string(T_copy{:, 37});
% Initialize the new column as a double array with the same size as the original column
newOrderNumberColumn = zeros(size(orderNumberColumn));
% Convert the string values to doubles
for i = 1:length(orderNumberColumn)
numValue = str2double(orderNumberColumn(i));
if isnan(numValue)
% If conversion fails (non-numeric value), set the value to 0
newOrderNumberColumn(i) = 0;
else
% Otherwise, use the numeric value
newOrderNumberColumn(i) = numValue;
end
end
% Replace the 37th column with the new double column by creating a new table
% Get the table variable names
varNames = T_copy.Properties.VariableNames;
How can I keep this from happening when I import the data in bulk?
Thanks!I have the following code in which I want to replace the column 37 in a table. I want to swap the column of categorical values for a column of numerical values.
% Open file selection dialog and allow multiple selections
[file_list, path_n] = uigetfile(‘*.csv’, ‘Select CSV Files’, ‘Multiselect’, ‘on’);
% Check if any files were selected
if ischar(file_list)
% Convert single file string to cell array
file_list = {file_list};
end
% Initialize a cell array to store the modified tables
modifiedTables = cell(length(file_list), 1);
% Loop through each selected file
for k = 1:length(file_list)
% Construct the full file path
filePath = fullfile(path_n, file_list{k});
% Import the CSV file as a table
T = readtable(filePath);
% Check if the table has at least 37 columns
if width(T) >= 37
% Extract the ‘OrderNumber’ column (column 37) and convert it to a string array
orderNumberColumn = string(T{:, 37});
% Initialize the new column as a double array with the same size as the original column
newOrderNumberColumn = zeros(size(orderNumberColumn));
% Convert the string values to doubles
for i = 1:length(orderNumberColumn)
numValue = str2double(orderNumberColumn(i));
if isnan(numValue)
% If conversion fails (non-numeric value), set the value to 0
newOrderNumberColumn(i) = 0;
else
% Otherwise, use the numeric value
newOrderNumberColumn(i) = numValue;
end
end
% Update only the 37th column with the new double column
T.(T.Properties.VariableNames{37}) = newOrderNumberColumn;
end
% Store the modified table in the cell array
modifiedTables{k} = T;
end
% Display the number of tables processed
disp([‘Number of tables processed: ‘, num2str(length(modifiedTables))]);
Unfortunately, the other columns (for example column 35, 36,38 and 39) also become affected when importing the csv files in bulk and hence my new modified table now contains NaNs even though I would like to only modify the column 37 (see "modifiedtables").
When I import via the user interface (see "imported_by_hand") or when I use the code below(see "T") that doesnt seem to happen.
T_copy = T;
% Extract the ‘OrderNumber’ column (column 37) and convert it to a string array
orderNumberColumn = string(T_copy{:, 37});
% Initialize the new column as a double array with the same size as the original column
newOrderNumberColumn = zeros(size(orderNumberColumn));
% Convert the string values to doubles
for i = 1:length(orderNumberColumn)
numValue = str2double(orderNumberColumn(i));
if isnan(numValue)
% If conversion fails (non-numeric value), set the value to 0
newOrderNumberColumn(i) = 0;
else
% Otherwise, use the numeric value
newOrderNumberColumn(i) = numValue;
end
end
% Replace the 37th column with the new double column by creating a new table
% Get the table variable names
varNames = T_copy.Properties.VariableNames;
How can I keep this from happening when I import the data in bulk?
Thanks! I have the following code in which I want to replace the column 37 in a table. I want to swap the column of categorical values for a column of numerical values.
% Open file selection dialog and allow multiple selections
[file_list, path_n] = uigetfile(‘*.csv’, ‘Select CSV Files’, ‘Multiselect’, ‘on’);
% Check if any files were selected
if ischar(file_list)
% Convert single file string to cell array
file_list = {file_list};
end
% Initialize a cell array to store the modified tables
modifiedTables = cell(length(file_list), 1);
% Loop through each selected file
for k = 1:length(file_list)
% Construct the full file path
filePath = fullfile(path_n, file_list{k});
% Import the CSV file as a table
T = readtable(filePath);
% Check if the table has at least 37 columns
if width(T) >= 37
% Extract the ‘OrderNumber’ column (column 37) and convert it to a string array
orderNumberColumn = string(T{:, 37});
% Initialize the new column as a double array with the same size as the original column
newOrderNumberColumn = zeros(size(orderNumberColumn));
% Convert the string values to doubles
for i = 1:length(orderNumberColumn)
numValue = str2double(orderNumberColumn(i));
if isnan(numValue)
% If conversion fails (non-numeric value), set the value to 0
newOrderNumberColumn(i) = 0;
else
% Otherwise, use the numeric value
newOrderNumberColumn(i) = numValue;
end
end
% Update only the 37th column with the new double column
T.(T.Properties.VariableNames{37}) = newOrderNumberColumn;
end
% Store the modified table in the cell array
modifiedTables{k} = T;
end
% Display the number of tables processed
disp([‘Number of tables processed: ‘, num2str(length(modifiedTables))]);
Unfortunately, the other columns (for example column 35, 36,38 and 39) also become affected when importing the csv files in bulk and hence my new modified table now contains NaNs even though I would like to only modify the column 37 (see "modifiedtables").
When I import via the user interface (see "imported_by_hand") or when I use the code below(see "T") that doesnt seem to happen.
T_copy = T;
% Extract the ‘OrderNumber’ column (column 37) and convert it to a string array
orderNumberColumn = string(T_copy{:, 37});
% Initialize the new column as a double array with the same size as the original column
newOrderNumberColumn = zeros(size(orderNumberColumn));
% Convert the string values to doubles
for i = 1:length(orderNumberColumn)
numValue = str2double(orderNumberColumn(i));
if isnan(numValue)
% If conversion fails (non-numeric value), set the value to 0
newOrderNumberColumn(i) = 0;
else
% Otherwise, use the numeric value
newOrderNumberColumn(i) = numValue;
end
end
% Replace the 37th column with the new double column by creating a new table
% Get the table variable names
varNames = T_copy.Properties.VariableNames;
How can I keep this from happening when I import the data in bulk?
Thanks! categorical variable, table, convert, import MATLAB Answers — New Questions
Why did I get two different results in nonlinear programing problems
clear,clc
A = [1 4 5
4 2 6
5 6 3];
prob = optimproblem;
x = optimvar(‘x’,3);
con = sum(x.^2) == 1;
prob.Constraints.con = con;
prob.Objective = x’*A*x;
x0.x = zeros(3,1);
% x0.x = rand(3,1);
show(prob)
[sol,fval,flag,out] = solve(prob,x0)
sol.x
when the initial point is zeres(0),fval is 0,sol.x is [0;0;0].
but when it is rand(3,1),fval is -3.66.
I can’t understand this reasonclear,clc
A = [1 4 5
4 2 6
5 6 3];
prob = optimproblem;
x = optimvar(‘x’,3);
con = sum(x.^2) == 1;
prob.Constraints.con = con;
prob.Objective = x’*A*x;
x0.x = zeros(3,1);
% x0.x = rand(3,1);
show(prob)
[sol,fval,flag,out] = solve(prob,x0)
sol.x
when the initial point is zeres(0),fval is 0,sol.x is [0;0;0].
but when it is rand(3,1),fval is -3.66.
I can’t understand this reason clear,clc
A = [1 4 5
4 2 6
5 6 3];
prob = optimproblem;
x = optimvar(‘x’,3);
con = sum(x.^2) == 1;
prob.Constraints.con = con;
prob.Objective = x’*A*x;
x0.x = zeros(3,1);
% x0.x = rand(3,1);
show(prob)
[sol,fval,flag,out] = solve(prob,x0)
sol.x
when the initial point is zeres(0),fval is 0,sol.x is [0;0;0].
but when it is rand(3,1),fval is -3.66.
I can’t understand this reason initial point MATLAB Answers — New Questions
Looking for a solution to automate inventory management of product accessories.
Hello Excel Community!
I’m looking for some sort of formula to be able to create an additional sheet within my current Excel Book to best track the inventory of the accessories we need to sell our items. This is the current set up of our doc, with a master list that I do not currently have access to, but a coworker does, that manages all of the Data Validation for columns C-H. Each drop down has a variety of values we use regularly to manage our intake and so we can find each item if/when our Access Database crashes multiple times a day.
Effectively, I’m looking for some way to track the quantities of the bags in column D in a separate sheet, as well as the potential for 1-2 more columns for hoods and/or batteries. This will free us up a substantial amount of time instead of having to count bags each week.
I’ve tried a few other solutions I’ve found on here with minimal luck. If I have to rebuild the entire thing from scratch to make something work, I definitely am up to doing that if it’s not possible with the current setup we run.
Thank you in advance for any help!
Hello Excel Community! I’m looking for some sort of formula to be able to create an additional sheet within my current Excel Book to best track the inventory of the accessories we need to sell our items. This is the current set up of our doc, with a master list that I do not currently have access to, but a coworker does, that manages all of the Data Validation for columns C-H. Each drop down has a variety of values we use regularly to manage our intake and so we can find each item if/when our Access Database crashes multiple times a day. Effectively, I’m looking for some way to track the quantities of the bags in column D in a separate sheet, as well as the potential for 1-2 more columns for hoods and/or batteries. This will free us up a substantial amount of time instead of having to count bags each week.I’ve tried a few other solutions I’ve found on here with minimal luck. If I have to rebuild the entire thing from scratch to make something work, I definitely am up to doing that if it’s not possible with the current setup we run. Thank you in advance for any help! Read More
New Outlook closes shortly after start
I’m trying to use the new outlook, but as soon as I open the application it closes and if I try to reopen it doesn’t work.
I’m trying to use the new outlook, but as soon as I open the application it closes and if I try to reopen it doesn’t work. Read More